mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
fix(linter): fix no_unused_vars panic when encountering unicode (#5582)
closes #4887
This commit is contained in:
parent
5f275516eb
commit
3b87ac48ce
1 changed files with 1 additions and 1 deletions
|
|
@ -10,5 +10,5 @@ use super::{NoUnusedVars, Symbol};
|
|||
// getting cast to a u32
|
||||
#[allow(clippy::cast_possible_truncation)]
|
||||
fn count_whitespace_or_commas<I: Iterator<Item = char>>(iter: I) -> u32 {
|
||||
iter.take_while(|c| c.is_whitespace() || *c == ',').count() as u32
|
||||
iter.take_while(|c| *c == ',' || c.is_whitespace()).map(|c| c.len_utf8() as u32).sum()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue