refactor(ast): AstKind::as_* methods take self (#5546)

Make `AstKind::as_*` methods (e.g. `AstKind::as_boolean_literal`) take `self`, not `&self`.

`AstKind` is `Copy`.

See: https://github.com/oxc-project/oxc/issues/5506#issuecomment-2332912976
This commit is contained in:
overlookmotel 2024-11-09 09:39:13 +00:00
parent 5cfdc05d06
commit d27e14f065
2 changed files with 332 additions and 332 deletions

File diff suppressed because it is too large Load diff

View file

@ -114,9 +114,9 @@ impl Generator for AstKindGenerator {
parse_quote!(
///@@line_break
#[inline]
pub fn #snake_case_name(&self) -> Option<&'a #typ> {
pub fn #snake_case_name(self) -> Option<&'a #typ> {
if let Self::#ident(v) = self {
Some(*v)
Some(v)
} else {
None
}