Skip to content

Commit

Permalink
Make closure capture independent of 2018 vs 2021 edition
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jun 2, 2022
1 parent 2581d0c commit d8587c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,11 @@ fn transform_block(context: Context, sig: &mut Signature, block: &mut Block) {
} else {
let pat = &arg.pat;
let ident = positional_arg(i, pat);
quote!(let #pat = #ident;)
if let Pat::Wild(_) = **pat {
quote!(let #ident = #ident;)
} else {
quote!(let #pat = #ident;)
}
}
}
})
Expand Down

0 comments on commit d8587c2

Please sign in to comment.