Skip to content

Commit

Permalink
attributes: extract match scrutinee (#2880)
Browse files Browse the repository at this point in the history
On clippy version 1.76.0 this gives a warning, extracting the
scrutinee to a variable fixes this.

Fixes: #2876
  • Loading branch information
kaffarell authored and davidbarsky committed Oct 2, 2024
1 parent 4779211 commit 2d30094
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tracing-attributes/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ fn gen_block<B: ToTokens>(
let mk_fut = match (err_event, ret_event) {
(Some(err_event), Some(ret_event)) => quote_spanned!(block.span()=>
async move {
match async move #block.await {
let __match_scrutinee = async move #block.await;
match __match_scrutinee {
#[allow(clippy::unit_arg)]
Ok(x) => {
#ret_event;
Expand Down

0 comments on commit 2d30094

Please sign in to comment.