Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API changes and cleanups (obsoletes #80) #81

Closed
wants to merge 10 commits into from
Prev Previous commit
reformatted imports
  • Loading branch information
duesee committed Mar 28, 2020
commit 21ab9eaf2283b269a6dec43a2238876423052ce6
10 changes: 8 additions & 2 deletions imap-proto/src/builders/command.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
use crate::quoted_string;
use crate::types::{AttrMacro, Attribute, State};
use crate::{
quoted_string,
types::{
Attribute,
AttrMacro,
State,
},
};

pub struct CommandBuilder {}

Expand Down
6 changes: 5 additions & 1 deletion imap-proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ pub mod builders;
pub mod parser;
pub mod types;

pub use crate::parser::{rfc3501::parse_response, rfc5464::resp_metadata, ParseResult};
pub use crate::parser::{
ParseResult,
rfc3501::parse_response,
rfc5464::resp_metadata,
};
pub use crate::types::*;

use std::borrow::Cow;
Expand Down
8 changes: 7 additions & 1 deletion imap-proto/src/parser/core.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
use nom::{self, IResult, character::streaming::digit1, sequence::tuple, bytes::streaming::{tag, take}};
use nom::{
self,
bytes::streaming::{tag, take},
duesee marked this conversation as resolved.
Show resolved Hide resolved
character::streaming::digit1,
IResult,
sequence::tuple,
};

use std::str;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we've come to agreement on the removal of the std::str import?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I forgot it. See last comment.


Expand Down
6 changes: 4 additions & 2 deletions imap-proto/src/parser/rfc3501/body.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use crate::parser::core::*;
use crate::types::*;
use crate::{
parser::core::*,
types::*,
};

named!(pub section_part<Vec<u32>>, do_parse!(
part: number >>
Expand Down
11 changes: 7 additions & 4 deletions imap-proto/src/parser/rfc3501/body_structure.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// rustfmt doesn't do a very good job on nom parser invocations.
#![cfg_attr(rustfmt, rustfmt_skip)]

use crate::parser::core::*;
use crate::types::*;

use crate::parser::rfc3501::envelope;
use crate::{
parser::{
core::*,
rfc3501::envelope,
},
types::*,
};

// body-fields = body-fld-param SP body-fld-id SP body-fld-desc SP
// body-fld-enc SP body-fld-octets
Expand Down
17 changes: 11 additions & 6 deletions imap-proto/src/parser/rfc3501/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@

use std::str;

use crate::parser::{ParseResult, rfc4551};
use crate::parser::rfc5464::resp_metadata;
use crate::types::*;
use crate::parser::core::*;
use crate::parser::rfc3501::body::*;
use crate::parser::rfc3501::body_structure::*;
use crate::{
parser::{
core::*,
ParseResult,
rfc3501::body::*,
rfc3501::body_structure::*,
rfc4551,
rfc5464::resp_metadata,
},
types::*,
};

pub mod body;
pub mod body_structure;
Expand Down
6 changes: 4 additions & 2 deletions imap-proto/src/parser/rfc4551.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
// rustfmt doesn't do a very good job on nom parser invocations.
#![cfg_attr(rustfmt, rustfmt_skip)]

use crate::parser::core::number_64;
use crate::types::*;
use crate::{
parser::core::number_64,
types::*,
};

// The highest mod-sequence value of all messages in the mailbox.
// Extends resp-test-code defined in rfc3501.
Expand Down
7 changes: 5 additions & 2 deletions imap-proto/src/parser/rfc5464.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@

use nom::IResult;

use crate::parser::core::*;
use crate::types::*;
use crate::{
parser::core::*,
types::*,
};

use std::str;

fn is_entry_component_char(c: u8) -> bool {
Expand Down