diff --git a/src/client.rs b/src/client.rs index 445343f..4384c42 100644 --- a/src/client.rs +++ b/src/client.rs @@ -7,8 +7,9 @@ use std::time::Duration; use super::authenticator::Authenticator; use super::error::{Error, ParseError, Result, ValidateError}; -use super::parse::{parse_authenticate_response, parse_capabilities, parse_fetches, parse_mailbox, - parse_names}; +use super::parse::{ + parse_authenticate_response, parse_capabilities, parse_fetches, parse_mailbox, parse_names, +}; use super::types::*; static TAG_PREFIX: &'static str = "a"; @@ -165,7 +166,10 @@ impl<'a, T: SetReadTimeout + Read + Write + 'a> IdleHandle<'a, T> { /// Block until the selected mailbox changes, or until the given amount of time has expired. pub fn wait_timeout(mut self, timeout: Duration) -> Result<()> { - self.client.stream.get_mut().set_read_timeout(Some(timeout))?; + self.client + .stream + .get_mut() + .set_read_timeout(Some(timeout))?; let res = self.wait_inner(); self.client.stream.get_mut().set_read_timeout(None).is_ok(); res @@ -274,9 +278,7 @@ impl Client { self.readline(&mut line)?; if line.starts_with(b"+") { - let data = parse_authenticate_response( - String::from_utf8(line).unwrap() - )?; + let data = parse_authenticate_response(String::from_utf8(line).unwrap())?; let auth_response = authenticator.process(data); self.write_line(auth_response.into_bytes().as_slice())? @@ -536,14 +538,14 @@ impl Client { use imap_proto::Status; match status { Status::Bad => { - break Err(Error::BadResponse(expl.unwrap_or( - "no explanation given".to_string(), - ))) + break Err(Error::BadResponse( + expl.unwrap_or("no explanation given".to_string()), + )) } Status::No => { - break Err(Error::NoResponse(expl.unwrap_or( - "no explanation given".to_string(), - ))) + break Err(Error::NoResponse( + expl.unwrap_or("no explanation given".to_string()), + )) } _ => break Err(Error::Parse(ParseError::Invalid(data.split_off(0)))), } diff --git a/src/parse.rs b/src/parse.rs index 298734b..7eb0ceb 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -96,7 +96,11 @@ pub fn parse_fetches(lines: Vec) -> ZeroCopyResult> { AttributeValue::Uid(uid) => fetch.uid = Some(uid), AttributeValue::Rfc822(rfc) => fetch.rfc822 = rfc, AttributeValue::Rfc822Header(rfc) => fetch.rfc822_header = rfc, - AttributeValue::BodySection {section: _, index: _, data} => fetch.body = data, + AttributeValue::BodySection { + section: _, + index: _, + data, + } => fetch.body = data, _ => {} } } diff --git a/src/types/capabilities.rs b/src/types/capabilities.rs index 41da7db..6221f1e 100644 --- a/src/types/capabilities.rs +++ b/src/types/capabilities.rs @@ -1,7 +1,7 @@ // Note that none of these fields are *actually* 'static. // Rather, they are tied to the lifetime of the `ZeroCopy` that contains this `Name`. -use std::collections::HashSet; use std::collections::hash_set::Iter; +use std::collections::HashSet; pub struct Capabilities(pub(crate) HashSet<&'static str>); use std::borrow::Borrow;