diff options
author | Prince <princedaryl3@tutanota.com> | 2021-05-13 06:40:58 +0300 |
---|---|---|
committer | Prince <princedaryl3@tutanota.com> | 2021-05-13 06:40:58 +0300 |
commit | 63aae9024964f79e58df4786fa73156e262f250c (patch) | |
tree | 7fa6597366dd7a480f4a4a2f3d99c28b0c1b1cd9 /src/ui | |
parent | 64bbaabdee4d7a9bacade3ecb7b2da8126fedf5d (diff) |
implement clippy fix: #[warn(clippy::single_match)]
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/views/tui_worker_view.rs | 7 | ||||
-rw-r--r-- | src/ui/widgets/tui_topbar.rs | 9 |
2 files changed, 5 insertions, 11 deletions
diff --git a/src/ui/views/tui_worker_view.rs b/src/ui/views/tui_worker_view.rs index c9e696a..387b279 100644 --- a/src/ui/views/tui_worker_view.rs +++ b/src/ui/views/tui_worker_view.rs @@ -43,11 +43,8 @@ impl TuiWorkerView { if let Ok(event) = context.poll_event() { match event { AppEvent::Termion(event) => { - match event { - Event::Key(Key::Esc) => { - break; - } - _ => {} + if let Event::Key(Key::Esc) = event { + break; } context.flush_event(); } diff --git a/src/ui/widgets/tui_topbar.rs b/src/ui/widgets/tui_topbar.rs index a73c911..06c27cb 100644 --- a/src/ui/widgets/tui_topbar.rs +++ b/src/ui/widgets/tui_topbar.rs @@ -34,12 +34,9 @@ impl<'a> Widget for TuiTopBar<'a> { let mut curr_path_str = self.path.to_string_lossy().into_owned(); if curr_path_str.len() > area.width as usize { - match self.path.file_name() { - Some(s) => { - curr_path_str = s.to_string_lossy().into_owned(); - ellipses = Some(Span::styled("…", path_style)); - } - None => {} + if let Some(s) = self.path.file_name() { + curr_path_str = s.to_string_lossy().into_owned(); + ellipses = Some(Span::styled("…", path_style)); } } if self |