From 2f4576c989411f1d64fc4b63d4b6275a7cdaa997 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 17 Aug 2025 12:48:14 +0200 Subject: [PATCH] bin/ui: Simplify impl of ShortcutsProps::shortcuts() Signed-off-by: Matthias Beyer --- src/ui/rm/widget/window.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ui/rm/widget/window.rs b/src/ui/rm/widget/window.rs index 75d61b4d..1f59e1e9 100644 --- a/src/ui/rm/widget/window.rs +++ b/src/ui/rm/widget/window.rs @@ -217,9 +217,11 @@ impl ShortcutsProps { pub fn shortcuts(mut self, shortcuts: &[(&str, &str)]) -> Self { self.shortcuts.clear(); - for (short, long) in shortcuts { - self.shortcuts.push((short.to_string(), long.to_string())); - } + self.shortcuts.extend( + shortcuts + .iter() + .map(|(s, l)| (s.to_string(), l.to_string())), + ); self }