summaryrefslogtreecommitdiffstats
path: root/src/commands/key_command.rs
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2020-12-13 12:42:53 -0500
committerJiayi Zhao <jeff.no.zhao@gmail.com>2020-12-13 12:42:53 -0500
commit2e5cdd07c2d8c18bad4099c82e36af64dc473a64 (patch)
treea9d7dee0f5a603cc96d6415a4549436a0f1818e0 /src/commands/key_command.rs
parent468e607c5d1cd5d554ae356fd3c8e78425840347 (diff)
code cleanup and fix path not showing when too long
Diffstat (limited to 'src/commands/key_command.rs')
-rw-r--r--src/commands/key_command.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/commands/key_command.rs b/src/commands/key_command.rs
index 1c32470..967bf2d 100644
--- a/src/commands/key_command.rs
+++ b/src/commands/key_command.rs
@@ -276,14 +276,12 @@ impl KeyCommand {
)),
},
},
- "tab_switch" => match arg {
- arg => match arg.parse::<i32>() {
- Ok(s) => Ok(Self::TabSwitch(s)),
- Err(e) => Err(JoshutoError::new(
- JoshutoErrorKind::IOInvalidData,
- format!("{}: {}", command, e.to_string()),
- )),
- },
+ "tab_switch" => match arg.parse::<i32>() {
+ Ok(s) => Ok(Self::TabSwitch(s)),
+ Err(e) => Err(JoshutoError::new(
+ JoshutoErrorKind::IOInvalidData,
+ format!("{}: {}", command, e.to_string()),
+ )),
},
"toggle_hidden" => Ok(Self::ToggleHiddenFiles),
inp => Err(JoshutoError::new(
@@ -348,7 +346,7 @@ impl JoshutoRunnable for KeyCommand {
Self::ToggleHiddenFiles => show_hidden::toggle_hidden(context),
- Self::Sort(t) => sort::set_sort(context, t.clone()),
+ Self::Sort(t) => sort::set_sort(context, *t),
Self::SortReverse => sort::toggle_reverse(context),
Self::TabSwitch(i) => {