mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-05 13:15:21 +00:00
refactor: Improve code formatting
This commit is contained in:
parent
6491b455ef
commit
dc38e3e10e
|
@ -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()
|
||||
|
@ -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| {
|
||||
[
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user