line_to_word applied to Dictionary::load

This commit is contained in:
boyska 2020-05-19 11:28:08 +02:00
parent ac99a172cc
commit 9f22e75549

View file

@ -24,6 +24,10 @@ impl Dictionary {
// so we're still using a normal Vec, and perform deduplication at load time
let mut aux_set = HashSet::new();
lines
.map(|res| match res {
Ok(word) => Ok(line_to_word(word.as_str())),
_ => res,
})
.filter(|res| match res {
Ok(word) => aux_set.insert(word.clone()),
_ => false,