From 5db6a0f198b9073c2540dcd5aa5180a50670f093 Mon Sep 17 00:00:00 2001 From: Gabriel Goller Date: Wed, 14 Feb 2024 22:23:15 +0100 Subject: [PATCH] attributes: extract match scrutinee On clippy version 1.76.0 this gives a warning, extracting the scrutinee to a variable fixes this. Fixes: #2876 --- tracing-attributes/src/expand.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tracing-attributes/src/expand.rs b/tracing-attributes/src/expand.rs index 8acc9e6e1..864bace8e 100644 --- a/tracing-attributes/src/expand.rs +++ b/tracing-attributes/src/expand.rs @@ -277,7 +277,8 @@ fn gen_block( 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;