diff --git a/src/words.rs b/src/words.rs index d324c93..8a5c8a5 100644 --- a/src/words.rs +++ b/src/words.rs @@ -31,7 +31,7 @@ fn words_from_file(path: impl AsRef) -> Result> { let file = File::open(path)?; Ok(BufReader::new(file) .lines() - .filter_map(|l| l.ok()) + .map_while(|l| l.ok()) .filter(|w| RE.is_match(w)) .collect()) }