Refactor line_to_word

Avoid taking ownership if not needed.
Use idiomatic rust.
This commit is contained in:
Blallo 2020-05-19 10:51:31 +02:00
parent e02fb4fecd
commit b552804b56
No known key found for this signature in database
GPG key ID: 0CBE577C9B72DC3F

View file

@ -47,11 +47,8 @@ impl Iterator for Dictionary {
}
}
fn line_to_word(l: String) -> String {
let l = unidecode(&l);
let l = l.to_lowercase();
let l = l.replace("'", "");
l
fn line_to_word(line: &str) -> String {
unidecode(&line.to_string()).to_lowercase().replace("'", "")
}
// filtri {{{