summaryrefslogtreecommitdiffstats
path: root/ui/src/components/mail/view/html.rs
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2018-08-23 15:36:52 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-06-10 19:40:31 +0300
commit2b6d1e0dbf47750ee4377d532fb6b38496e4b336 (patch)
tree4d0dbb939d66ececb4629c00caa5f301d9930098 /ui/src/components/mail/view/html.rs
parentb617fc013681f3c2a9b6f49fa6e2af8261bf99c7 (diff)
Run clippy lints
Diffstat (limited to 'ui/src/components/mail/view/html.rs')
-rw-r--r--ui/src/components/mail/view/html.rs45
1 files changed, 21 insertions, 24 deletions
diff --git a/ui/src/components/mail/view/html.rs b/ui/src/components/mail/view/html.rs
index bb308a0f..a9dbc717 100644
--- a/ui/src/components/mail/view/html.rs
+++ b/ui/src/components/mail/view/html.rs
@@ -70,31 +70,28 @@ impl Component for HtmlView {
if self.pager.process_event(event, context) {
return true;
}
- match event.event_type {
- UIEventType::Input(Key::Char('v')) => {
- // TODO: Optional filter that removes outgoing resource requests (images and
- // scripts)
- let binary = query_default_app("text/html");
- if let Ok(binary) = binary {
- let mut p = create_temp_file(&self.bytes, None);
- Command::new(&binary)
- .arg(p.path())
- .stdin(Stdio::piped())
- .stdout(Stdio::piped())
- .spawn()
- .unwrap_or_else(|_| panic!("Failed to start {}", binary.display()));
- context.temp_files.push(p);
- } else {
- context.replies.push_back(UIEvent {
- id: 0,
- event_type: UIEventType::StatusNotification(format!(
- "Couldn't find a default application for html files."
- )),
- });
- }
- return true;
+ if let UIEventType::Input(Key::Char('v')) = event.event_type {
+ // TODO: Optional filter that removes outgoing resource requests (images and
+ // scripts)
+ let binary = query_default_app("text/html");
+ if let Ok(binary) = binary {
+ let mut p = create_temp_file(&self.bytes, None);
+ Command::new(&binary)
+ .arg(p.path())
+ .stdin(Stdio::piped())
+ .stdout(Stdio::piped())
+ .spawn()
+ .unwrap_or_else(|_| panic!("Failed to start {}", binary.display()));
+ context.temp_files.push(p);
+ } else {
+ context.replies.push_back(UIEvent {
+ id: 0,
+ event_type: UIEventType::StatusNotification(
+ "Couldn't find a default application for html files.".to_string(),
+ ),
+ });
}
- _ => {}
+ return true;
}
false
}