diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-02-20 20:56:36 -0500 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-02-20 20:56:36 -0500 |
commit | 60b35381b3437c4eca80e4338e75d9f454dd150f (patch) | |
tree | b608a50b4447948b80228f0bbb9aa8f164a121ec /src | |
parent | c7497dd187e9729aef2630f22b481d02864ad3bb (diff) |
remove dyn for Box<Trait>
Diffstat (limited to 'src')
-rw-r--r-- | src/commands/mod.rs | 4 | ||||
-rw-r--r-- | src/config/keymap.rs | 2 | ||||
-rw-r--r-- | src/run.rs | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 9130cac..09fbfb7 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -44,7 +44,7 @@ use crate::structs; #[derive(Debug)] pub enum CommandKeybind { - SimpleKeybind(Box<dyn JoshutoCommand>), + SimpleKeybind(Box<JoshutoCommand>), CompositeKeybind(HashMap<i32, CommandKeybind>), } @@ -69,7 +69,7 @@ pub struct ProgressInfo { pub total_bytes: u64, } -pub fn from_args(command: &str, args: Option<&Vec<String>>) -> Option<Box<dyn JoshutoCommand>> { +pub fn from_args(command: &str, args: Option<&Vec<String>>) -> Option<Box<JoshutoCommand>> { match command { "cd" => { if let Some(args) = args { diff --git a/src/config/keymap.rs b/src/config/keymap.rs index eb0c81c..6b4a1f1 100644 --- a/src/config/keymap.rs +++ b/src/config/keymap.rs @@ -63,7 +63,7 @@ impl JoshutoKeymap { fn insert_keycommand( map: &mut HashMap<i32, commands::CommandKeybind>, - keycommand: Box<dyn commands::JoshutoCommand>, + keycommand: Box<commands::JoshutoCommand>, keys: &[String], ) { if keys.len() == 1 { @@ -11,7 +11,7 @@ use crate::window::JoshutoPanel; fn recurse_get_keycommand( keymap: &HashMap<i32, CommandKeybind>, -) -> Option<&Box<dyn JoshutoCommand>> { +) -> Option<&Box<JoshutoCommand>> { let (term_rows, term_cols) = ui::getmaxyx(); ncurses::timeout(-1); @@ -176,7 +176,7 @@ pub fn run(config_t: config::JoshutoConfig, keymap_t: config::JoshutoKeymap) { continue; } - let keycommand: &Box<dyn JoshutoCommand>; + let keycommand: &Box<JoshutoCommand>; match keymap_t.keymaps.get(&ch) { Some(CommandKeybind::CompositeKeybind(m)) => match recurse_get_keycommand(&m) { |