refactor(cli): 🔨 lint issues
This commit is contained in:
parent
d621a0a657
commit
56544deb56
@ -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,
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user