Skip to content

Commit

Permalink
fix: clippy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvxa committed Aug 29, 2024
1 parent e3b0952 commit 7367de6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions crates/oxc_regular_expression/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl<'a> Display for Alternative<'a> {
write_join_with(f, "", &self.body, |iter| {
let next = iter.next()?;
let Some(next) = as_character(next) else { return Some(next.to_string()) };
let peek = iter.peek().and_then(|it| as_character(*it));
let peek = iter.peek().and_then(|it| as_character(it));
let (result, eat) = character_to_string(next, peek);
if eat {
_ = iter.next();
Expand Down Expand Up @@ -221,7 +221,7 @@ impl<'a> Display for CharacterClass<'a> {
write_join_with(f, sep, &self.body, |iter| {
let next = iter.next()?;
let Some(next) = as_character(next) else { return Some(next.to_string()) };
let peek = iter.peek().and_then(|it| as_character(*it));
let peek = iter.peek().and_then(|it| as_character(it));
let (result, eat) = character_to_string(next, peek);
if eat {
_ = iter.next();
Expand Down Expand Up @@ -388,7 +388,7 @@ fn character_to_string(
format!(r"\{ch}")
}
CharacterKind::Symbol => format!("{ch}"),
CharacterKind::Null => format!(r"\0"),
CharacterKind::Null => String::from(r"\0"),
CharacterKind::UnicodeEscape => {
// we remove the leading `0x` of our 4 digit hex number.
let hex = &format!("{cp:#4X}")[2..];
Expand Down Expand Up @@ -503,7 +503,6 @@ mod test {
fn test_display(allocator: &Allocator, (source, expect, unicode): Case) {
use crate::{Parser, ParserOptions};
let expect = expect.unwrap_or(source);
dbg!(source);
let parsed_utf16 =
Parser::new(allocator, source, ParserOptions::default()).parse().unwrap();
assert_eq!(expect, parsed_utf16.to_string());
Expand Down

0 comments on commit 7367de6

Please sign in to comment.