diff --git a/.cargo/config.toml b/.cargo/config.toml index 902ceebb7cea1..4796a2c26965c 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -30,7 +30,4 @@ rustflags = [ "-Aclippy::derivable_impls", # false positives "-Aclippy::stable_sort_primitive", # prefer stable sort "-Aclippy::extra-unused-type-parameters", # stylistic - "-Aclippy::let_with_type_underscore" # used as a workaround for an infinite macro expansion loop in clippy - # specifying this as an attribute directly in the affected macro - # triggers other weird rust 1.70 bugs ] diff --git a/frame/assets/src/benchmarking.rs b/frame/assets/src/benchmarking.rs index ff20b3e187217..982edf33514cf 100644 --- a/frame/assets/src/benchmarking.rs +++ b/frame/assets/src/benchmarking.rs @@ -144,7 +144,7 @@ benchmarks_instance_pallet! { let caller = T::CreateOrigin::ensure_origin(origin.clone(), &asset_id.into()).unwrap(); let caller_lookup = T::Lookup::unlookup(caller.clone()); T::Currency::make_free_balance_be(&caller, DepositBalanceOf::::max_value()); - }: _(origin, asset_id.clone(), caller_lookup, 1u32.into()) + }: _(origin, asset_id, caller_lookup, 1u32.into()) verify { assert_last_event::(Event::Created { asset_id: asset_id.into(), creator: caller.clone(), owner: caller }.into()); } diff --git a/frame/benchmarking/src/v1.rs b/frame/benchmarking/src/v1.rs index be6dc393cbce3..acfdbce965206 100644 --- a/frame/benchmarking/src/v1.rs +++ b/frame/benchmarking/src/v1.rs @@ -661,7 +661,7 @@ macro_rules! benchmark_backend { { $( PRE { $( $pre_parsed:tt )* } )* } { $eval:block } { - let $pre_id:tt : $pre_ty:ty = $pre_ex:expr; + let $pre_id:tt $( : $pre_ty:ty )? = $pre_ex:expr; $( $rest:tt )* } $postcode:block @@ -672,7 +672,7 @@ macro_rules! benchmark_backend { { $( $where_clause )* } { $( PRE { $( $pre_parsed )* } )* - PRE { $pre_id , $pre_ty , $pre_ex } + PRE { $pre_id , $( $pre_ty , )? $pre_ex } } { $eval } { $( $rest )* } @@ -756,39 +756,13 @@ macro_rules! benchmark_backend { $postcode } }; - // mutation arm to look after `let _ =` - ( - { $( $instance:ident: $instance_bound:tt )? } - $name:ident - { $( $where_clause:tt )* } - { $( $parsed:tt )* } - { $eval:block } - { - let $pre_id:tt = $pre_ex:expr; - $( $rest:tt )* - } - $postcode:block - ) => { - $crate::benchmark_backend! { - { $( $instance: $instance_bound )? } - $name - { $( $where_clause )* } - { $( $parsed )* } - { $eval } - { - let $pre_id : _ = $pre_ex; - $( $rest )* - } - $postcode - } - }; // actioning arm ( { $( $instance:ident: $instance_bound:tt )? } $name:ident { $( $where_clause:tt )* } { - $( PRE { $pre_id:tt , $pre_ty:ty , $pre_ex:expr } )* + $( PRE { $pre_id:tt , $( $pre_ty:ty , )? $pre_ex:expr } )* $( PARAM { $param:ident , $param_from:expr , $param_to:expr , $param_instancer:expr } )* } { $eval:block } @@ -823,7 +797,7 @@ macro_rules! benchmark_backend { .1; )* $( - let $pre_id : $pre_ty = $pre_ex; + let $pre_id $( : $pre_ty )? = $pre_ex; )* $( $param_instancer ; )* $( $post )* diff --git a/frame/nfts/src/benchmarking.rs b/frame/nfts/src/benchmarking.rs index 2be115f17a474..45390bf032bd6 100644 --- a/frame/nfts/src/benchmarking.rs +++ b/frame/nfts/src/benchmarking.rs @@ -680,9 +680,9 @@ benchmarks_instance_pallet! { let buyer_lookup = T::Lookup::unlookup(buyer.clone()); let price = ItemPrice::::from(0u32); let origin = SystemOrigin::Signed(seller.clone()).into(); - Nfts::::set_price(origin, collection, item, Some(price.clone()), Some(buyer_lookup))?; + Nfts::::set_price(origin, collection, item, Some(price), Some(buyer_lookup))?; T::Currency::make_free_balance_be(&buyer, DepositBalanceOf::::max_value()); - }: _(SystemOrigin::Signed(buyer.clone()), collection, item, price.clone()) + }: _(SystemOrigin::Signed(buyer.clone()), collection, item, price) verify { assert_last_event::(Event::ItemBought { collection,