Make getting keybinding for display more efficient (#27046)

No longer iterates all the matching bindings, and no longer clones the
result.

Release Notes:

- N/A
This commit is contained in:
Michael Sloan
2025-03-19 20:15:33 +00:00
committed by GitHub
parent 33faa66e35
commit 3ec69a5bc0
3 changed files with 13 additions and 9 deletions
+1 -1
View File
@@ -290,7 +290,7 @@ impl MacPlatform {
action,
os_action,
} => {
let keystrokes = crate::Keymap::binding_to_display_from_bindings(
let keystrokes = crate::Keymap::binding_to_display_from_bindings_iterator(
keymap.bindings_for_action(action.as_ref()),
)
.map(|binding| binding.keystrokes());