Format let-else ❤️ 🎉

This commit is contained in:
Louis Dureuil
2023-07-03 10:20:28 +02:00
parent 661d1f90dc
commit 324d448236
11 changed files with 38 additions and 37 deletions

View File

@ -80,7 +80,9 @@ impl MatchingWords {
let word = self.word_interner.get(*word);
// if the word is a prefix we match using starts_with.
if located_words.is_prefix && token.lemma().starts_with(word) {
let Some((char_index, c)) = word.char_indices().take(located_words.original_char_count).last() else {
let Some((char_index, c)) =
word.char_indices().take(located_words.original_char_count).last()
else {
continue;
};
let prefix_length = char_index + c.len_utf8();