attributes: extract match scrutinee (#2880)

On clippy version 1.76.0 this gives a warning, extracting the
scrutinee to a variable fixes this.

Fixes: #2876
This commit is contained in:
Gabriel Goller 2024-03-12 02:29:33 +01:00 committed by GitHub
parent 571c5305bc
commit 36bf06310c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;