Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Remove clippy workaround (#14424)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchr authored Jun 21, 2023
1 parent e64926e commit 755065f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 36 deletions.
3 changes: 0 additions & 3 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
2 changes: 1 addition & 1 deletion frame/assets/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<T, I>::max_value());
}: _<T::RuntimeOrigin>(origin, asset_id.clone(), caller_lookup, 1u32.into())
}: _<T::RuntimeOrigin>(origin, asset_id, caller_lookup, 1u32.into())
verify {
assert_last_event::<T, I>(Event::Created { asset_id: asset_id.into(), creator: caller.clone(), owner: caller }.into());
}
Expand Down
34 changes: 4 additions & 30 deletions frame/benchmarking/src/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 )* }
Expand Down Expand Up @@ -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 }
Expand Down Expand Up @@ -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 )*
Expand Down
4 changes: 2 additions & 2 deletions frame/nfts/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -680,9 +680,9 @@ benchmarks_instance_pallet! {
let buyer_lookup = T::Lookup::unlookup(buyer.clone());
let price = ItemPrice::<T, I>::from(0u32);
let origin = SystemOrigin::Signed(seller.clone()).into();
Nfts::<T, I>::set_price(origin, collection, item, Some(price.clone()), Some(buyer_lookup))?;
Nfts::<T, I>::set_price(origin, collection, item, Some(price), Some(buyer_lookup))?;
T::Currency::make_free_balance_be(&buyer, DepositBalanceOf::<T, I>::max_value());
}: _(SystemOrigin::Signed(buyer.clone()), collection, item, price.clone())
}: _(SystemOrigin::Signed(buyer.clone()), collection, item, price)
verify {
assert_last_event::<T, I>(Event::ItemBought {
collection,
Expand Down

0 comments on commit 755065f

Please sign in to comment.