mirror of
https://github.com/crate-ci/typos.git
synced 2025-01-09 08:14:53 -05:00
perf(parser): Limit inner-loop assers
This commit is contained in:
parent
287c4cbfe9
commit
09d2124d0f
1 changed files with 2 additions and 2 deletions
|
@ -185,7 +185,7 @@ mod parser {
|
||||||
std::iter::from_fn(move || match next_literal(input) {
|
std::iter::from_fn(move || match next_literal(input) {
|
||||||
Ok((i, o)) => {
|
Ok((i, o)) => {
|
||||||
input = i;
|
input = i;
|
||||||
assert_ne!(o, "");
|
debug_assert_ne!(o, "");
|
||||||
Some(o)
|
Some(o)
|
||||||
}
|
}
|
||||||
_ => None,
|
_ => None,
|
||||||
|
@ -333,7 +333,7 @@ impl<'s> Iterator for SplitIdent<'s> {
|
||||||
while let Some((i, c)) = self.char_indices.next() {
|
while let Some((i, c)) = self.char_indices.next() {
|
||||||
let cur_mode = WordMode::classify(c);
|
let cur_mode = WordMode::classify(c);
|
||||||
if cur_mode == WordMode::Boundary {
|
if cur_mode == WordMode::Boundary {
|
||||||
assert!(self.start_mode == WordMode::Boundary);
|
debug_assert!(self.start_mode == WordMode::Boundary);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if self.start_mode == WordMode::Boundary {
|
if self.start_mode == WordMode::Boundary {
|
||||||
|
|
Loading…
Reference in a new issue