Skip to content

Commit

Permalink
refactor(ast_tools): shorter code in AstKindGenerator (#6775)
Browse files Browse the repository at this point in the history
Tiny refactor. Shorten code a little and avoid converting `Ident`s unnecessarily.
  • Loading branch information
overlookmotel committed Oct 22, 2024
1 parent 4689865 commit 09d2df1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tasks/ast_tools/src/generators/ast_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ impl Generator for AstKindGenerator {
})
.collect_vec();

let types: Vec<Variant> =
have_kinds.iter().map(|(ident, _)| parse_quote!(#ident)).collect_vec();
let types = have_kinds.iter().map(|(ident, _)| ident).collect_vec();

let kinds: Vec<Variant> =
have_kinds.iter().map(|(ident, typ)| parse_quote!(#ident(&'a #typ))).collect_vec();
Expand Down

0 comments on commit 09d2df1

Please sign in to comment.