mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-22 21:25:57 +00:00
optimization
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
This commit is contained in:
parent
23f5d45307
commit
fb527f6281
|
@ -27,8 +27,10 @@ pub fn create_shortcut_list(
|
||||||
shortcuts: impl IntoIterator<Item = Shortcut>,
|
shortcuts: impl IntoIterator<Item = Shortcut>,
|
||||||
render_width: u16,
|
render_width: u16,
|
||||||
) -> Box<[Line<'static>]> {
|
) -> Box<[Line<'static>]> {
|
||||||
let hints = shortcuts.into_iter().collect::<Box<[Shortcut]>>();
|
let shortcut_spans: Vec<Vec<Span<'static>>> = shortcuts
|
||||||
let shortcut_spans: Vec<Vec<Span<'static>>> = hints.iter().map(|h| h.to_spans()).collect();
|
.into_iter()
|
||||||
|
.map(|h| h.to_spans())
|
||||||
|
.collect();
|
||||||
|
|
||||||
let max_shortcut_width = shortcut_spans
|
let max_shortcut_width = shortcut_spans
|
||||||
.iter()
|
.iter()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user