diff options
author | quentin konieczko <konieczko@gmail.com> | 2022-10-21 18:13:56 +0200 |
---|---|---|
committer | quentin konieczko <konieczko@gmail.com> | 2022-10-21 18:13:56 +0200 |
commit | 637ad17fa9db38e5e95557aa090819ccb26914fd (patch) | |
tree | c7fa6fcc2b146c8a3ba960aecc52aff09335ae68 /src/actioner.rs | |
parent | 39fb5bbb9797a270471a63f7ab2117fba0ea4a9b (diff) |
removes unwraps
Diffstat (limited to 'src/actioner.rs')
-rw-r--r-- | src/actioner.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/actioner.rs b/src/actioner.rs index 6806122..165dbdb 100644 --- a/src/actioner.rs +++ b/src/actioner.rs @@ -80,7 +80,7 @@ impl Actioner { Event::Key(Key::WheelDown(_, _, _)) => self.down(tabs), Event::Key(Key::SingleClick(MouseButton::Left, row, _)) => self.left_click(tabs, row), Event::Key(Key::SingleClick(MouseButton::Right, row, _)) => self.right_click(tabs, row), - Event::Key(Key::Ctrl('f')) => self.ctrl_f(tabs), + Event::Key(Key::Ctrl('f')) => self.ctrl_f(tabs).unwrap_or_default(), _ => {} } } @@ -269,10 +269,11 @@ impl Actioner { } } - fn ctrl_f(&self, tabs: &mut Status) { - let output = Skimer::new(self.term.clone()).no_source(tabs.selected_non_mut().path_str()); + fn ctrl_f(&self, tabs: &mut Status) -> Option<()> { + let output = Skimer::new(self.term.clone()).no_source(tabs.selected_non_mut().path_str()?); let _ = self.term.clear(); tabs.create_tabs_from_skim(output); + Some(()) } /// Match read key to a relevent event, depending on keybindings. |