From fb527f62810cc97153ab7d46d7fc9055bccc66be Mon Sep 17 00:00:00 2001 From: Nyx <144965845+nnyyxxxx@users.noreply.github.com> Date: Tue, 1 Oct 2024 21:29:08 -0400 Subject: [PATCH] optimization Co-authored-by: Adam Perkowski --- tui/src/hint.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tui/src/hint.rs b/tui/src/hint.rs index f634ac73..a51b204a 100644 --- a/tui/src/hint.rs +++ b/tui/src/hint.rs @@ -27,8 +27,10 @@ pub fn create_shortcut_list( shortcuts: impl IntoIterator, render_width: u16, ) -> Box<[Line<'static>]> { - let hints = shortcuts.into_iter().collect::>(); - let shortcut_spans: Vec>> = hints.iter().map(|h| h.to_spans()).collect(); + let shortcut_spans: Vec>> = shortcuts + .into_iter() + .map(|h| h.to_spans()) + .collect(); let max_shortcut_width = shortcut_spans .iter()