diff --git a/lib/cli/tui/framework/app.rs b/lib/cli/tui/framework/app.rs index 34830fa..9f441db 100644 --- a/lib/cli/tui/framework/app.rs +++ b/lib/cli/tui/framework/app.rs @@ -79,7 +79,7 @@ impl App { Event::Render => self.send(Action::Render)?, // Event::Resize(x, y) => self.send(Action::Resize(x, y))?, Event::Key(key) => { - if let Some(action) = self.keybindings.get(&vec![key]) { + if let Some(action) = self.keybindings.get(&[key]) { self.send(action.clone())?; } else { // If the key was not handled as a single key action, diff --git a/lib/cli/tui/framework/keyboard.rs b/lib/cli/tui/framework/keyboard.rs index 00e8819..54d96f4 100644 --- a/lib/cli/tui/framework/keyboard.rs +++ b/lib/cli/tui/framework/keyboard.rs @@ -21,8 +21,8 @@ impl KeyBindings { let action = Action::from_str(&cmd); match action { - Ok(action) => (parse_key_sequence(&key_str).unwrap(), action), - Err(_) => (parse_key_sequence(&key_str).unwrap(), Action::AppAction(cmd)), + Ok(action) => (parse_key_sequence(key_str).unwrap(), action), + Err(_) => (parse_key_sequence(key_str).unwrap(), Action::AppAction(cmd)), } }) .collect(); @@ -137,7 +137,7 @@ pub fn key_event_to_string(key_event: &KeyEvent) -> String { char = format!("f({c})"); &char } - KeyCode::Char(c) if c == ' ' => "space", + KeyCode::Char(' ') => "space", KeyCode::Char(c) => { char = c.to_string(); &char