diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-03-16 21:02:35 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-03-16 21:02:35 -0400 |
commit | a0286692964d120ee8a6ea36fbfb2f577dc2305c (patch) | |
tree | 453f2dbecd19f5d68d421f18c9e9f6b91bf1d96f /src/util | |
parent | 1475597b83fa0afbb6ddec979f6a8030a8c64db9 (diff) |
cargo clippy
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/key_mapping.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/key_mapping.rs b/src/util/key_mapping.rs index 4b0dbc3..31f20a8 100644 --- a/src/util/key_mapping.rs +++ b/src/util/key_mapping.rs @@ -39,14 +39,14 @@ pub fn str_to_key(s: &str) -> Option<Key> { } if s.starts_with("ctrl+") { - let ch = s.chars().skip("ctrl+".len()).next(); + let ch = s.chars().nth("ctrl+".len()); let key = match ch { Some(ch) => Some(Key::Ctrl(ch)), None => None, }; return key; } else if s.starts_with("alt+") { - let ch = s.chars().skip("alt+".len()).next(); + let ch = s.chars().nth("alt+".len()); let key = match ch { Some(ch) => Some(Key::Alt(ch)), None => None, @@ -60,5 +60,5 @@ pub fn str_to_key(s: &str) -> Option<Key> { }; return key; } - return None; + None } |