refactor: follow clippy suggestions

This commit is contained in:
graelo 2021-03-13 18:51:31 +01:00
parent 7e28931f6c
commit ffd8e9b12d
7 changed files with 38 additions and 69 deletions

View file

@ -6,7 +6,7 @@ use crate::error;
///
/// Keep in mind letters 'n' and 'y' are systematically removed at runtime to
/// prevent conflict with navigation and yank/copy keys.
const ALPHABETS: [(&'static str, &'static str); 21] = [
const ALPHABETS: [(&str, &str); 21] = [
// ("abcd", "abcd"),
("qwerty", "asdfqwerzxcvjklmiuopghtybn"),
("qwerty-homerow", "asdfjklgh"),
@ -47,7 +47,7 @@ pub fn parse_alphabet(src: &str) -> Result<Alphabet, error::ParseError> {
match alphabet_pair {
Some((_name, letters)) => {
let letters = letters.replace(&['n', 'N', 'y', 'Y'][..], "");
Ok(Alphabet(letters.to_string()))
Ok(Alphabet(letters))
}
None => Err(error::ParseError::UnknownAlphabet),
}