Radish alpha
r
rad:z39mP9rQAaGmERfUMPULfPUi473tY
Radicle terminal user interface
Radicle
Git
bin/ui: Simplify impl of ShortcutsProps::shortcuts()
Matthias Beyer committed 4 months ago
commit 2f4576c989411f1d64fc4b63d4b6275a7cdaa997
parent 02dc8e9
1 file changed +5 -3
modified 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
    }