Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Mar 13, 2023
1 parent e44706b commit df74d1b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/swc_ecma_parser/src/lexer/whitespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ const UNI: ByteHandler = Some(|skip| {
skip.input.get_unchecked(skip.offset..)
};

let (len, c) = unsafe {
let c = unsafe {
// Safety: Byte handlers are called only when `skip.input` is not empty
s.char_indices().next().unwrap_unchecked()
s.chars().next().unwrap_unchecked()
};

match c {
Expand All @@ -60,7 +60,7 @@ const UNI: ByteHandler = Some(|skip| {
_ => return 0,
}

len
c.len_utf8()
});

/// API is taked from oxc by Boshen (https://github.com/Boshen/oxc/pull/26)
Expand Down

0 comments on commit df74d1b

Please sign in to comment.