This commit is contained in:
Michael Zhang 2021-08-09 01:32:16 -05:00
parent e2e606f324
commit 47d80b1950
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B
3 changed files with 7 additions and 3 deletions

View file

@ -2,10 +2,14 @@
//! ---
//!
//! ```no_run
//! # use panorama_imap::client::Config;
//! # async fn client() -> anyhow::Result<()> {
//! let client = Config::builder()
//! .hostname("your.domain")
//! .hostname("your.domain".to_owned())
//! .port(993)
//! .open().await?;
//! # Ok(())
//! # }
//! ```
#[macro_use]

View file

@ -68,7 +68,7 @@ macro_rules! paren {
pub fn parse_u32(s: impl AsRef<[u8]>) -> Result<u32> {
let mut total = 0u32;
let s = s.as_ref();
for digit in s.iter().rev() {
for digit in s.iter() {
total *= 10;
if !is_digit(*digit) {
bail!("invalid digit {}", digit)

View file

@ -138,7 +138,7 @@ rule!(pub list_wildcards : u8 => satisfy(is_list_wildcards));
pub fn literal(i: Bytes) -> IResult<Bytes, Bytes> {
let mut length_of = terminated(delimited(byte(b'{'), number, byte(b'}')), CRLF);
let (i, length) = length_of(i)?;
println!("length is: {:?}", length);
debug!("length is: {:?}", length);
map(take(length), Bytes::from)(i)
}