Skip to content

Commit

Permalink
refactor: Improve code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
lj3954 committed Oct 12, 2024
1 parent 6491b45 commit dc38e3e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tui/src/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ pub fn create_shortcut_list(

if rest.is_empty() {
break;
} else {
shortcut_spans = rest;
}

shortcut_spans = rest;
}

lines.into_boxed_slice()
Expand All @@ -79,8 +79,8 @@ impl Shortcut {
}

fn to_spans(&self) -> Vec<Span<'static>> {
let mut ret: Vec<_> = self
.key_sequences
let description = Span::styled(self.desc, Style::default().italic());
self.key_sequences
.iter()
.flat_map(|seq| {
[
Expand All @@ -89,8 +89,7 @@ impl Shortcut {
Span::default().content("] "),
]
})
.collect();
ret.push(Span::styled(self.desc, Style::default().italic()));
ret
.chain(std::iter::once(description))
.collect()
}
}

0 comments on commit dc38e3e

Please sign in to comment.