Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(traverse): do not use AstBuilder::*_from_* methods #7069

Commits on Nov 2, 2024

  1. refactor(traverse): do not use AstBuilder::*_from_* methods (#7069)

    Preparation for #7073. Avoid using `AstBuilder::*_from_*` methods to construct enums, use explicit construction instead.
    
    Before:
    
    ```rs
    let ident = self.ast.binding_pattern_kind_from_binding_identifier(ident);
    ```
    
    After:
    
    ```rs
    let ident = BindingPatternKind::BindingIdentifier(ident);
    ```
    
    Often this produces shorter code, as well as (in my opinion) being easier to read.
    overlookmotel committed Nov 2, 2024
    Configuration menu
    Copy the full SHA
    938ee87 View commit details
    Browse the repository at this point in the history