diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-05-13 22:05:00 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-06-10 19:40:49 +0300 |
commit | 4582bcd5ae6a5ad7725a5a89f3e421de007d1525 (patch) | |
tree | 6c61e9a369b2d7b9336c3d5f361f856a58ca0636 /ui/src/components/mail/view/html.rs | |
parent | de81fd1a689baf370e95330bd1a2ca873b389c96 (diff) |
fix warnings and lints
Diffstat (limited to 'ui/src/components/mail/view/html.rs')
-rw-r--r-- | ui/src/components/mail/view/html.rs | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/ui/src/components/mail/view/html.rs b/ui/src/components/mail/view/html.rs index 60e5b34c..0c89db9e 100644 --- a/ui/src/components/mail/view/html.rs +++ b/ui/src/components/mail/view/html.rs @@ -70,36 +70,31 @@ impl HtmlView { )); display_text } - } else { - if let Ok(mut html_filter) = Command::new("w3m") - .args(&["-I", "utf-8", "-T", "text/html"]) - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .spawn() - { - html_filter - .stdin - .as_mut() - .unwrap() - .write_all(&bytes) - .expect("Failed to write to html filter stdin"); - let mut display_text = String::from( - "Text piped through `w3m`. Press `v` to open in web browser. \n\n", - ); - display_text.push_str(&String::from_utf8_lossy( - &html_filter.wait_with_output().unwrap().stdout, - )); + } else if let Ok(mut html_filter) = Command::new("w3m") + .args(&["-I", "utf-8", "-T", "text/html"]) + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .spawn() + { + html_filter + .stdin + .as_mut() + .unwrap() + .write_all(&bytes) + .expect("Failed to write to html filter stdin"); + let mut display_text = + String::from("Text piped through `w3m`. Press `v` to open in web browser. \n\n"); + display_text.push_str(&String::from_utf8_lossy( + &html_filter.wait_with_output().unwrap().stdout, + )); - display_text - } else { - context.replies.push_back(UIEvent::Notification( - Some(format!( - "Failed to find any application to use as html filter" - )), - String::new(), - )); - String::from_utf8_lossy(&bytes).to_string() - } + display_text + } else { + context.replies.push_back(UIEvent::Notification( + Some("Failed to find any application to use as html filter".to_string()), + String::new(), + )); + String::from_utf8_lossy(&bytes).to_string() }; if body.count_attachments() > 1 { display_text = |