diff --git a/src/main.rs b/src/main.rs index b28a358..181076c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,15 +12,16 @@ fn main() { let fname = &args[1]; let regexp = &args[2]; - let w = vec![]; - let mut d = Dictionary{words: w}; + let mut w = vec![]; let f = File::open(fname).unwrap(); let buf = BufReader::new(&f); for line in buf.lines() { let line = line.unwrap(); // TODO: normalizza: lascia solo a-z, converti gli accenti, ecc. - d.words.push(line.to_string()) + w.push(line.to_string()) } + + let d = Dictionary{words: w}; let re = Regex::new(regexp).unwrap(); for w in &d.words { if re.is_match(w) {