ui: fix some lints

embed
Manos Pitsidianakis 2019-07-06 12:47:27 +03:00
parent a655a85b5f
commit 74be47ec5a
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
5 changed files with 8 additions and 12 deletions

View File

@ -699,5 +699,5 @@ pub fn send_draft(context: &mut Context, account_cursor: usize, draft: Draft) ->
), ),
)); ));
} }
return !failure; !failure
} }

View File

@ -123,9 +123,7 @@ impl ListingTrait for CompactListing {
} else { } else {
Color::Default Color::Default
}; };
let bg_color = if self.cursor_pos.2 == idx && self.selection[&i] { let bg_color = if self.cursor_pos.2 == idx {
Color::Byte(246 | 210)
} else if self.cursor_pos.2 == idx {
Color::Byte(246) Color::Byte(246)
} else if self.selection[&i] { } else if self.selection[&i] {
Color::Byte(210) Color::Byte(210)

View File

@ -55,8 +55,8 @@ impl<'a> Default for UnsubscribeOption<'a> {
impl<'a> Clone for UnsubscribeOption<'a> { impl<'a> Clone for UnsubscribeOption<'a> {
fn clone(&self) -> Self { fn clone(&self) -> Self {
match self { match self {
UnsubscribeOption::Url(a) => UnsubscribeOption::Url(a.clone()), UnsubscribeOption::Url(a) => UnsubscribeOption::Url(<&[u8]>::clone(a)),
UnsubscribeOption::Email(a) => UnsubscribeOption::Email(a.clone()), UnsubscribeOption::Email(a) => UnsubscribeOption::Email(<&[u8]>::clone(a)),
} }
} }
} }

View File

@ -899,12 +899,10 @@ impl Component for StatusBar {
if parse_command(&self.ex_buffer.as_str().as_bytes()) if parse_command(&self.ex_buffer.as_str().as_bytes())
.to_full_result() .to_full_result()
.is_ok() .is_ok()
{ && self.cmd_history.last().map(String::as_str)
if self.cmd_history.last().map(String::as_str)
!= Some(self.ex_buffer.as_str()) != Some(self.ex_buffer.as_str())
{ {
self.cmd_history.push(self.ex_buffer.as_str().to_string()); self.cmd_history.push(self.ex_buffer.as_str().to_string());
}
} }
self.ex_buffer.clear(); self.ex_buffer.clear();
} }

View File

@ -137,7 +137,7 @@ impl<'a> Iterator for MailboxIterator<'a> {
if let Some(Err(_)) = self.folders[&fh] { if let Some(Err(_)) = self.folders[&fh] {
return Some(None); return Some(None);
} }
return Some(Some(self.folders[&fh].as_ref().unwrap().as_ref().unwrap())); Some(Some(self.folders[&fh].as_ref().unwrap().as_ref().unwrap()))
} }
} }