refactor: Improve code formatting

This commit is contained in:
Liam 2024-10-12 09:45:22 -07:00
parent 6491b455ef
commit dc38e3e10e
No known key found for this signature in database

View File

@ -59,9 +59,9 @@ pub fn create_shortcut_list(
if rest.is_empty() { if rest.is_empty() {
break; break;
} else {
shortcut_spans = rest;
} }
shortcut_spans = rest;
} }
lines.into_boxed_slice() lines.into_boxed_slice()
@ -79,8 +79,8 @@ impl Shortcut {
} }
fn to_spans(&self) -> Vec<Span<'static>> { fn to_spans(&self) -> Vec<Span<'static>> {
let mut ret: Vec<_> = self let description = Span::styled(self.desc, Style::default().italic());
.key_sequences self.key_sequences
.iter() .iter()
.flat_map(|seq| { .flat_map(|seq| {
[ [
@ -89,8 +89,7 @@ impl Shortcut {
Span::default().content("] "), Span::default().content("] "),
] ]
}) })
.collect(); .chain(std::iter::once(description))
ret.push(Span::styled(self.desc, Style::default().italic())); .collect()
ret
} }
} }