Skip to content

Commit

Permalink
chore: clippy (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdheepak committed Feb 12, 2024
1 parent 5d84d65 commit fb81b8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/serde_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub mod keybindings {
if key_events.is_empty() {
None
} else if let Some(Some(command)) = self.0.get(&mode).map(|kb| kb.get(key_events)) {
Some(command.clone())
Some(*command)
} else {
self.event_to_command(mode, &key_events[1..])
}
Expand Down Expand Up @@ -134,7 +134,7 @@ pub mod keybindings {
.collect::<Vec<String>>()
.join("");

string_event_map.insert(key_string, command.clone());
string_event_map.insert(key_string, *command);
}

serialized_map.insert(*mode, string_event_map);
Expand Down
6 changes: 3 additions & 3 deletions src/widgets/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn key_bindings_for_command(mode: Mode, command: Command) -> Vec<String> {
/// updates the selected index based on the current mode
///
/// Only changes the selected index for the first render
fn select_by_mode(state: &mut Help, rows: &Vec<(Mode, Command, String)>) {
fn select_by_mode(state: &mut Help, rows: &[(Mode, Command, String)]) {
if let Some(mode) = state.mode {
tracing::debug!("{:?}", mode);
let selected = rows
Expand All @@ -106,11 +106,11 @@ fn select_by_mode(state: &mut Help, rows: &Vec<(Mode, Command, String)>) {
);
}

fn into_rows<'a>(rows: &'a [(Mode, Command, String)]) -> impl Iterator<Item = Row<'a>> {
fn into_rows(rows: &[(Mode, Command, String)]) -> impl Iterator<Item = Row<'_>> {
rows.iter().map(|(mode, command, keys)| {
Row::new([
Line::styled(format!("{} ", mode), Color::DarkGray),
Line::raw(format!("{}", keys)),
Line::raw(keys.to_string()),
Line::raw(format!("{:?} ", command)),
])
.fg(config::get().color.base05)
Expand Down

0 comments on commit fb81b8d

Please sign in to comment.