anagram pattern is normalized
This commit is contained in:
parent
86b9a60648
commit
3184fc4ccf
1 changed files with 1 additions and 3 deletions
|
@ -64,8 +64,6 @@ fn matches_regexp(regexp: &str) -> (impl std::ops::FnMut(&&String) -> bool) {
|
|||
move |w| re.is_match(w.as_str())
|
||||
}
|
||||
|
||||
|
||||
|
||||
fn sort_word(word: &str) -> Result<String, impl std::error::Error> {
|
||||
// funzione ausiliaria, utile per la is_anagram e cose simili
|
||||
// ritorna una COPIA
|
||||
|
@ -77,7 +75,7 @@ fn sort_word(word: &str) -> Result<String, impl std::error::Error> {
|
|||
|
||||
fn is_anagram(word: &str) -> (impl std::ops::FnMut(&&String) -> bool) {
|
||||
// filtro
|
||||
let sorted_word = sort_word(word).unwrap();
|
||||
let sorted_word = sort_word(line_to_word(word.to_string()).as_str()).unwrap();
|
||||
move |w| {
|
||||
sorted_word == sort_word(w.as_str()).unwrap()
|
||||
}
|
||||
|
|
Reference in a new issue