From 868448eb833c68ab5694e44f7d4ced96292fa033 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Sun, 29 Mar 2026 12:40:02 +0000 Subject: [PATCH] docs(ast): correct comment (#20837) `format_atom!` takes allocator as first param. Correct a doc comment to show the correct usage. --- crates/oxc_ast/src/ast/literal.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/oxc_ast/src/ast/literal.rs b/crates/oxc_ast/src/ast/literal.rs index 776e9b01ebbc4..83c7b5e26c04c 100644 --- a/crates/oxc_ast/src/ast/literal.rs +++ b/crates/oxc_ast/src/ast/literal.rs @@ -182,7 +182,7 @@ pub struct RegExpPattern<'a> { /// /// If `pattern` is defined, `pattern` and `text` must be in sync. /// i.e. If you alter the regexp by mutating `pattern`, you must regenerate `text` to match it, - /// using `format_atom!("{}", &pattern)`. + /// using `format_atom!(&allocator, "{pattern}")`. /// /// `oxc_codegen` ignores `pattern` field, and prints `text`. #[estree(rename = "pattern")]