From 93f4f1a536fe32fd9682ab9b668b3c547651615e Mon Sep 17 00:00:00 2001 From: branchseer Date: Sat, 28 Dec 2024 13:18:18 +0800 Subject: [PATCH] fix cargo lint warnings --- crates/oxc_parser/src/lexer/token.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/oxc_parser/src/lexer/token.rs b/crates/oxc_parser/src/lexer/token.rs index 30914c6903fcc..b9782b127fb91 100644 --- a/crates/oxc_parser/src/lexer/token.rs +++ b/crates/oxc_parser/src/lexer/token.rs @@ -70,12 +70,13 @@ impl Token { cold_branch(|| { self.len = u16::MAX; long_ends.insert(self.start, end); - }) + }); } } #[inline] pub fn end(&self, long_ends: &FxHashMap) -> u32 { + #[allow(clippy::if_not_else)] if self.len != u16::MAX { self.start + u32::from(self.len) } else { @@ -94,7 +95,7 @@ impl Token { } #[inline] pub fn set_escaped(&mut self) { - self.flags.insert(TokenFlags::Escaped) + self.flags.insert(TokenFlags::Escaped); } #[inline] @@ -104,7 +105,7 @@ impl Token { #[inline] pub fn set_is_on_new_line(&mut self) { - self.flags.insert(TokenFlags::IsOnNewLine) + self.flags.insert(TokenFlags::IsOnNewLine); } #[inline]