Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

fix(fst-dict): not incrementing loop variable when consuming from levenshtein

Grant Lemonsfd0655f8f09a
diff --git a/harper-core/src/spell/fst_dictionary.rs b/harper-core/src/spell/fst_dictionary.rs
index c0b23a3d5..020ee993c 100644
--- a/harper-core/src/spell/fst_dictionary.rs
+++ b/harper-core/src/spell/fst_dictionary.rs
@@ -74,13 +74,14 @@ impl Dictionary for FstDictionary {
let mut word_indexes_stream = self.word_map.search(aut).into_stream();
let mut word_indexes = Vec::with_capacity(max_results);
- let i = 0;
+ let mut i = 0;
while i < max_results {
if let Some(v) = word_indexes_stream.next() {
word_indexes.push(v.1);
} else {
break;
}
+ i += 1;
}
word_indexes
.into_iter()