diff --git a/crates/oxc_codegen/src/gen.rs b/crates/oxc_codegen/src/gen.rs index df617833c..2afca8952 100644 --- a/crates/oxc_codegen/src/gen.rs +++ b/crates/oxc_codegen/src/gen.rs @@ -960,7 +960,7 @@ fn print_non_negative_float(value: f64, _p: &Codegen<{ MINIF let len = chars.len(); let dot = chars.iter().position(|&c| c == b'.'); let u8_to_string = |num: &[u8]| { - // SAFETY: criterias of `from_utf8_unchecked`.are met. + // SAFETY: criteria of `from_utf8_unchecked`.are met. unsafe { String::from_utf8_unchecked(num.to_vec()) } }; diff --git a/crates/oxc_codegen/src/lib.rs b/crates/oxc_codegen/src/lib.rs index 0b19265c3..6d388cb84 100644 --- a/crates/oxc_codegen/src/lib.rs +++ b/crates/oxc_codegen/src/lib.rs @@ -98,7 +98,7 @@ impl Codegen { } pub fn into_code(self) -> String { - // SAFETY: criterias of `from_utf8_unchecked`.are met. + // SAFETY: criteria of `from_utf8_unchecked`.are met. unsafe { String::from_utf8_unchecked(self.code) } } @@ -154,7 +154,7 @@ impl Codegen { } fn peek_nth(&self, n: usize) -> Option { - // SAFETY: criterias of `from_utf8_unchecked`.are met. + // SAFETY: criteria of `from_utf8_unchecked`.are met. unsafe { from_utf8_unchecked(self.code()) }.chars().nth_back(n) } diff --git a/crates/oxc_formatter/src/lib.rs b/crates/oxc_formatter/src/lib.rs index 7ac33ecda..b07a06340 100644 --- a/crates/oxc_formatter/src/lib.rs +++ b/crates/oxc_formatter/src/lib.rs @@ -127,7 +127,7 @@ impl Formatter { #[inline] pub fn into_code(self) -> String { - // SAFETY: criterias of `from_utf8_unchecked`.are met. + // SAFETY: criteria of `from_utf8_unchecked`.are met. unsafe { String::from_utf8_unchecked(self.code) } }