Skip to content
Snippets Groups Projects
Commit 95fb618b authored by Patrick Lam's avatar Patrick Lam
Browse files

rewrite to avoid compiler warning

parent 3f3feaf2
No related branches found
No related tags found
No related merge requests found
......@@ -189,11 +189,7 @@ fn process_dictionary_builder_line(line: String, lookahead_line: Option<String>,
for doubles in tokens2.windows(2) {
let double_tmp = format!("{}^{}", doubles[0], doubles[1]);
if let Some(count) = dbl.get(&double_tmp) {
dbl.insert(double_tmp, count+1);
} else {
dbl.insert(double_tmp, 1);
}
*dbl.entry(double_tmp.to_owned()).or_default() += 1;
}
let mut tokens3_ = match prev2 {
......@@ -206,11 +202,7 @@ fn process_dictionary_builder_line(line: String, lookahead_line: Option<String>,
};
for triples in tokens3.windows(3) {
let triple_tmp = format!("{}^{}^{}", triples[0], triples[1], triples[2]);
if let Some(count) = trpl.get(&triple_tmp) {
trpl.insert(triple_tmp, count+1);
} else {
trpl.insert(triple_tmp, 1);
}
*trpl.entry(triple_tmp.to_owned()).or_default() += 1;
}
return (last1, last2);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment