-
Notifications
You must be signed in to change notification settings - Fork 1
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
Last stuff #18
Last stuff #18
Conversation
- Making the attributes of mboxes independent. We can store them now as well! - Added more docs - Added type-safety for flags - Expanded flags a bit - Added more tests - Added a short summary of the file-structure in the beginning of the doc.
Fixing help command description.
Fixing a little test issue
src/imap/model.rs
Outdated
/// } | ||
/// ``` | ||
pub fn add_flags(&mut self, mbox: &str, uid_seq: &str, flags: Flags) -> Result<()> { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why adding a new line here? It does not really fit the global style of the code base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed now.
src/imap/model.rs
Outdated
/// Remove the flags to the message by the given information. Take a look on the example above. | ||
/// It's pretty similar. | ||
pub fn remove_flags(&mut self, mbox: &str, uid_seq: &str, flags: Flags) -> Result<()> { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why adding a new line here? It does not really fit the global style of the code base.
src/imap/model.rs
Outdated
/// } | ||
/// ``` | ||
pub fn set_flags(&mut self, mbox: &str, uid_seq: &str, flags: Flags) -> Result<()> { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why adding a new line here? It does not really fit the global style of the code base.
src/imap/model.rs
Outdated
#[derive(Debug)] | ||
pub struct ImapConnector<'a> { | ||
pub account: &'a Account, | ||
pub sess: imap::Session<TlsStream<TcpStream>>, | ||
} | ||
|
||
impl<'a> ImapConnector<'a> { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why adding a new line here? It does not really fit the global style of the code base.
src/flag/model.rs
Outdated
@@ -73,6 +71,94 @@ impl ToString for Flags { | |||
} | |||
} | |||
|
|||
impl ToString for Flags { | |||
fn to_string(&self) -> String { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why adding a new line here? It does not really fit the global style of the code base.
} | ||
|
||
// remove the trailing whitespace with the comma |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about .trim_end_matches()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well it's just a single whitespace, so I thought that pop might suit here. The compiler knows that he needs to remove only one character instead of looking after more whitespaces. At least I think that the compiler will think like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But what if one time there is no white space? Or if we have an empty String
? The program will panic, where the trim_end_matches
will not. I know it's a bit extreme, but the less panicking code we have the better we will be (in my opinion).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm... ok, hold o!, I'll fix that quickly in a quick PR. (sorry, missread this part... ._.)
- Removed bold + capital words for logout-doc - Run format on each *.rs file
@soywod I threw |
Ok, I found the issue for the tests! The account has the smtp server etc. set to |
- Testing the return value of the flags struct as a string doesn't really work since it's a HashSet => Converted it into a Vec (in the test) to set the order as well. - Fixed imap test by reverting the changes in the test.
Changed error output when creating an Imap-Connection. Should help debugging :)
@soywod tests are working now! You can review it again! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Please take a careful look into the
mbox/model.rs
file @soywod ! This is the last PR as far as I can tell. If I find something else, then I can make a PR on your repository after its merge ;)