mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
refactor(ast): inline AstKind::as_* methods (#5547)
One would hope compiler will inline these trivial methods anyway, but mark them `#[inline]` to make sure.
This commit is contained in:
parent
fefbbc1a5e
commit
14ee086182
2 changed files with 169 additions and 0 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -161,6 +161,7 @@ impl Generator for AstKindGenerator {
|
|||
format_ident!("as_{}", ident.to_string().to_case(Case::Snake));
|
||||
parse_quote!(
|
||||
///@@line_break
|
||||
#[inline]
|
||||
pub fn #snake_case_name(&self) -> Option<&'a #typ> {
|
||||
if let Self::#ident(v) = self {
|
||||
Some(*v)
|
||||
|
|
|
|||
Loading…
Reference in a new issue