summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2019-02-20 20:56:36 -0500
committerJiayi Zhao <jeff.no.zhao@gmail.com>2019-02-20 20:56:36 -0500
commit60b35381b3437c4eca80e4338e75d9f454dd150f (patch)
treeb608a50b4447948b80228f0bbb9aa8f164a121ec
parentc7497dd187e9729aef2630f22b481d02864ad3bb (diff)
remove dyn for Box<Trait>
-rw-r--r--config/joshuto.toml1
-rw-r--r--src/commands/mod.rs4
-rw-r--r--src/config/keymap.rs2
-rw-r--r--src/run.rs4
4 files changed, 6 insertions, 5 deletions
diff --git a/config/joshuto.toml b/config/joshuto.toml
index ec6c8b4..4c5c6c5 100644
--- a/config/joshuto.toml
+++ b/config/joshuto.toml
@@ -9,6 +9,7 @@ column_ratio = [1, 3, 4]
scroll_offset = 6
sort_type = "natural"
+
[sort_option]
show_hidden = false
case_sensitive = false
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 {
diff --git a/src/run.rs b/src/run.rs
index 7c86e0e..d5a6cad 100644
--- a/src/run.rs
+++ b/src/run.rs
@@ -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) {