Miscellaneous small changes (#1238)
* Use a slice instead of a new object * Remove unnecessary 'into_iter' * Use 'and_then' instead of 'map_or'
This commit is contained in:
parent
6608a0241d
commit
05a1f4280c
3 changed files with 2 additions and 6 deletions
|
|
@ -520,10 +520,7 @@ fn retrieve_keycode(event: id) -> Option<VirtualKeyCode> {
|
|||
#[inline]
|
||||
fn get_code(ev: id, raw: bool) -> Option<VirtualKeyCode> {
|
||||
let characters = get_characters(ev, raw);
|
||||
characters
|
||||
.chars()
|
||||
.next()
|
||||
.map_or(None, |c| char_to_keycode(c))
|
||||
characters.chars().next().and_then(|c| char_to_keycode(c))
|
||||
}
|
||||
|
||||
// Cmd switches Roman letters for Dvorak-QWERTY layout, so we try modified characters first.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue