From 1f1eb6c4977afed9a4ca1f0ef9066bb05543bba0 Mon Sep 17 00:00:00 2001 From: Boshen Date: Mon, 16 Oct 2023 15:31:07 +0800 Subject: [PATCH] chore: fix spelling --- crates/oxc_codegen/src/gen.rs | 2 +- crates/oxc_codegen/src/lib.rs | 4 ++-- crates/oxc_formatter/src/lib.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/oxc_codegen/src/gen.rs b/crates/oxc_codegen/src/gen.rs index df617833c4c23..2afca89527879 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 0b19265c30613..6d388cb84100b 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 7ac33ecda6a0e..b07a06340e97c 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) } }