suggester: Avoid panic rotating titlecased suggestion to front

This commit is contained in:
Michael Davis
2024-11-09 13:54:51 -05:00
parent 99a63bb6ab
commit e282b05c55

View File

@@ -135,7 +135,9 @@ impl<'a, S: BuildHasher> Suggester<'a, S> {
.upper_char_at(suggestion, after_space_idx);
out[i] = titled;
// Rotate this suggestion to the front. (I think? TODO)
out[..i].rotate_right(1);
if i > 0 {
out[..i].rotate_right(1);
}
}
}
Casing::All => {