diff --git a/crates/oxc_codegen/src/code_buffer.rs b/crates/oxc_codegen/src/code_buffer.rs index 5f2a1aa6995ab..339a8ee11f5f5 100644 --- a/crates/oxc_codegen/src/code_buffer.rs +++ b/crates/oxc_codegen/src/code_buffer.rs @@ -262,11 +262,11 @@ impl CodeBuffer { /// code.print_ascii([b'f', b'o', b'o'].into_iter()); /// assert_eq!(String::from(code), "foo"); /// ``` - pub fn print_ascii(&mut self, chars: I) + pub fn print_ascii(&mut self, bytes: I) where I: IntoIterator, { - let iter = chars.into_iter(); + let iter = bytes.into_iter(); let hint = iter.size_hint(); self.buf.reserve(hint.1.unwrap_or(hint.0)); for c in iter { @@ -355,12 +355,12 @@ impl AsRef<[u8]> for CodeBuffer { impl From for String { #[inline] - fn from(printer: CodeBuffer) -> Self { + fn from(buffer: CodeBuffer) -> Self { if cfg!(debug_assertions) { - String::from_utf8(printer.buf).unwrap() + String::from_utf8(buffer.buf).unwrap() } else { // SAFETY: `buf` is valid UTF-8 because of invariants upheld by `CodeBuffer` - unsafe { String::from_utf8_unchecked(printer.buf) } + unsafe { String::from_utf8_unchecked(buffer.buf) } } } }