refactor(cli): 🔨 lint issues

This commit is contained in:
Lucas Colombo 2024-09-17 03:47:32 -03:00
parent d621a0a657
commit 56544deb56
Signed by: lucas
GPG Key ID: EF34786CFEFFAE35
2 changed files with 4 additions and 4 deletions

View File

@ -79,7 +79,7 @@ impl App {
Event::Render => self.send(Action::Render)?, Event::Render => self.send(Action::Render)?,
// Event::Resize(x, y) => self.send(Action::Resize(x, y))?, // Event::Resize(x, y) => self.send(Action::Resize(x, y))?,
Event::Key(key) => { Event::Key(key) => {
if let Some(action) = self.keybindings.get(&vec![key]) { if let Some(action) = self.keybindings.get(&[key]) {
self.send(action.clone())?; self.send(action.clone())?;
} else { } else {
// If the key was not handled as a single key action, // If the key was not handled as a single key action,

View File

@ -21,8 +21,8 @@ impl KeyBindings {
let action = Action::from_str(&cmd); let action = Action::from_str(&cmd);
match action { match action {
Ok(action) => (parse_key_sequence(&key_str).unwrap(), action), Ok(action) => (parse_key_sequence(key_str).unwrap(), action),
Err(_) => (parse_key_sequence(&key_str).unwrap(), Action::AppAction(cmd)), Err(_) => (parse_key_sequence(key_str).unwrap(), Action::AppAction(cmd)),
} }
}) })
.collect(); .collect();
@ -137,7 +137,7 @@ pub fn key_event_to_string(key_event: &KeyEvent) -> String {
char = format!("f({c})"); char = format!("f({c})");
&char &char
} }
KeyCode::Char(c) if c == ' ' => "space", KeyCode::Char(' ') => "space",
KeyCode::Char(c) => { KeyCode::Char(c) => {
char = c.to_string(); char = c.to_string();
&char &char