diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-05-31 16:20:27 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-05-31 16:20:27 -0400 |
commit | 281249d5d78a88681f24182d34065cad565d5d82 (patch) | |
tree | 7de1a55cea58074b22c5175a6c85d3cce79f212e /src/config | |
parent | f741728044c6e4f06481b74821f125553a92dd8d (diff) |
cargo fmt
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/keymap.rs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/config/keymap.rs b/src/config/keymap.rs index f5c8eb1..2f834d1 100644 --- a/src/config/keymap.rs +++ b/src/config/keymap.rs @@ -79,12 +79,12 @@ pub struct JoshutoKeyMapping { pub home: i32, #[serde(default = "default_end")] pub end: i32, -/* - #[serde(default = "default_up")] - pub page_up: i32, - #[serde(default = "default_up")] - pub page_down: i32, -*/ + /* + #[serde(default = "default_up")] + pub page_up: i32, + #[serde(default = "default_up")] + pub page_down: i32, + */ #[serde(default = "default_backspace")] pub backspace: i32, #[serde(default = "default_delete")] @@ -167,7 +167,11 @@ impl ConfigStructure for JoshutoCommandMapping { } } -fn insert_keycommand(map: &mut JoshutoCommandMapping, keycommand: Box<JoshutoCommand>, keys: &[i32]) { +fn insert_keycommand( + map: &mut JoshutoCommandMapping, + keycommand: Box<JoshutoCommand>, + keys: &[i32], +) { match keys.len() { 0 => {} 1 => match map.entry(keys[0]) { @@ -190,7 +194,7 @@ fn insert_keycommand(map: &mut JoshutoCommandMapping, keycommand: Box<JoshutoCom } }, Entry::Vacant(entry) => { - let mut new_map = HashMap::new(); + let mut new_map = JoshutoCommandMapping::new(); insert_keycommand(&mut new_map, keycommand, &keys[1..]); let composite_command = CommandKeybind::CompositeKeybind(new_map); entry.insert(composite_command); |