From 23a46f31618eac6ffcb37e6708aef0d1efd7bef6 Mon Sep 17 00:00:00 2001 From: Victor Genin Date: Wed, 13 Dec 2023 01:57:06 +0200 Subject: [PATCH] clippy changes --- pallets/ddc-customers/src/lib.rs | 3 ++- pallets/ddc-customers/src/mock.rs | 8 +++++--- pallets/ddc-payouts/src/lib.rs | 2 +- pallets/ddc-payouts/src/tests.rs | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pallets/ddc-customers/src/lib.rs b/pallets/ddc-customers/src/lib.rs index 9a66d168e..191af3ecc 100644 --- a/pallets/ddc-customers/src/lib.rs +++ b/pallets/ddc-customers/src/lib.rs @@ -238,7 +238,7 @@ pub mod pallet { if balance < min { if let Some(vault) = &self.feeder_account { let _ = ::Currency::transfer( - &vault, + vault, &account_id, min - balance, ExistenceRequirement::AllowDeath, @@ -246,6 +246,7 @@ pub mod pallet { } else { let _ = ::Currency::make_free_balance_be(&account_id, min); } + } for &(ref cluster_id, ref owner_id, ref deposit) in &self.buckets { let cur_bucket_id = >::get() diff --git a/pallets/ddc-customers/src/mock.rs b/pallets/ddc-customers/src/mock.rs index ee0b19e2f..d9e847eb0 100644 --- a/pallets/ddc-customers/src/mock.rs +++ b/pallets/ddc-customers/src/mock.rs @@ -243,9 +243,11 @@ impl ExtBuilder { } .assimilate_storage(&mut storage); - let _customer_genesis = - pallet_ddc_customers::GenesisConfig:: { feeder_account: None } - .assimilate_storage(&mut storage); + let _customer_genesis = pallet_ddc_customers::GenesisConfig:: { + feeder_account: None, + buckets: Default::default(), + } + .assimilate_storage(&mut storage); TestExternalities::new(storage) } diff --git a/pallets/ddc-payouts/src/lib.rs b/pallets/ddc-payouts/src/lib.rs index 908eb33b1..42ed6080f 100644 --- a/pallets/ddc-payouts/src/lib.rs +++ b/pallets/ddc-payouts/src/lib.rs @@ -948,7 +948,7 @@ pub mod pallet { if balance < min { if let Some(vault) = &self.feeder_account { let _ = ::Currency::transfer( - &vault, + vault, &account_id, min - balance, ExistenceRequirement::AllowDeath, diff --git a/pallets/ddc-payouts/src/tests.rs b/pallets/ddc-payouts/src/tests.rs index 29012da01..f4d1732af 100644 --- a/pallets/ddc-payouts/src/tests.rs +++ b/pallets/ddc-payouts/src/tests.rs @@ -1515,7 +1515,7 @@ fn send_rewarding_providers_batch_works100nodes() { node_batch.clear(); } } - if node_batch.len() > 0 { + if !node_batch.is_empty() { payees.push(node_batch.clone()); } @@ -1553,7 +1553,7 @@ fn send_rewarding_providers_batch_works100nodes() { user_batch.clear(); } } - if user_batch.len() > 0 { + if !user_batch.is_empty() { payers.push(user_batch.clone()); }