doc
This commit is contained in:
parent
e2e606f324
commit
47d80b1950
3 changed files with 7 additions and 3 deletions
|
@ -2,10 +2,14 @@
|
||||||
//! ---
|
//! ---
|
||||||
//!
|
//!
|
||||||
//! ```no_run
|
//! ```no_run
|
||||||
|
//! # use panorama_imap::client::Config;
|
||||||
|
//! # async fn client() -> anyhow::Result<()> {
|
||||||
//! let client = Config::builder()
|
//! let client = Config::builder()
|
||||||
//! .hostname("your.domain")
|
//! .hostname("your.domain".to_owned())
|
||||||
//! .port(993)
|
//! .port(993)
|
||||||
//! .open().await?;
|
//! .open().await?;
|
||||||
|
//! # Ok(())
|
||||||
|
//! # }
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
|
@ -68,7 +68,7 @@ macro_rules! paren {
|
||||||
pub fn parse_u32(s: impl AsRef<[u8]>) -> Result<u32> {
|
pub fn parse_u32(s: impl AsRef<[u8]>) -> Result<u32> {
|
||||||
let mut total = 0u32;
|
let mut total = 0u32;
|
||||||
let s = s.as_ref();
|
let s = s.as_ref();
|
||||||
for digit in s.iter().rev() {
|
for digit in s.iter() {
|
||||||
total *= 10;
|
total *= 10;
|
||||||
if !is_digit(*digit) {
|
if !is_digit(*digit) {
|
||||||
bail!("invalid digit {}", digit)
|
bail!("invalid digit {}", digit)
|
||||||
|
|
|
@ -138,7 +138,7 @@ rule!(pub list_wildcards : u8 => satisfy(is_list_wildcards));
|
||||||
pub fn literal(i: Bytes) -> IResult<Bytes, Bytes> {
|
pub fn literal(i: Bytes) -> IResult<Bytes, Bytes> {
|
||||||
let mut length_of = terminated(delimited(byte(b'{'), number, byte(b'}')), CRLF);
|
let mut length_of = terminated(delimited(byte(b'{'), number, byte(b'}')), CRLF);
|
||||||
let (i, length) = length_of(i)?;
|
let (i, length) = length_of(i)?;
|
||||||
println!("length is: {:?}", length);
|
debug!("length is: {:?}", length);
|
||||||
map(take(length), Bytes::from)(i)
|
map(take(length), Bytes::from)(i)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue