Skip to content

Commit

Permalink
attributes: extract match scrutinee in err-only case
Browse files Browse the repository at this point in the history
A large match scrutinee was causing clippy warnings. PR #2880
fixed this for the case where both err and ret are present,
but the exact same issue occurs with just err present, and that
has not been fixed.

This pull request applies the same fix to the err-only case.
  • Loading branch information
mrozycki committed Dec 4, 2024
1 parent b02a700 commit 47dd937
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 @@ -293,7 +293,8 @@ fn gen_block<B: ToTokens>(
),
(Some(err_event), None) => 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) => Ok(x),
Err(e) => {
Expand Down

0 comments on commit 47dd937

Please sign in to comment.