From ac8f2554d8290b0b68c38fe40cd5c4c8c87f7edf Mon Sep 17 00:00:00 2001 From: bgallois <benjamin@gallois.cc> Date: Tue, 13 Feb 2024 14:43:16 +0100 Subject: [PATCH] fix unused_must_use --- pallets/distance/src/lib.rs | 2 +- pallets/oneshot-account/src/lib.rs | 13 +++++++++---- pallets/universal-dividend/src/lib.rs | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/pallets/distance/src/lib.rs b/pallets/distance/src/lib.rs index ddcff5218..4860ff4b4 100644 --- a/pallets/distance/src/lib.rs +++ b/pallets/distance/src/lib.rs @@ -555,7 +555,7 @@ pub mod pallet { } Some(false) => { // negative result, slash and deposit event - T::Currency::slash_reserved( + let _ = T::Currency::slash_reserved( &requester, <T as Config>::EvaluationPrice::get(), ); diff --git a/pallets/oneshot-account/src/lib.rs b/pallets/oneshot-account/src/lib.rs index 0c86b3ce4..637debf4d 100644 --- a/pallets/oneshot-account/src/lib.rs +++ b/pallets/oneshot-account/src/lib.rs @@ -147,7 +147,7 @@ pub mod pallet { Error::<T>::OneshotAccountAlreadyCreated ); - <T::Currency as Currency<T::AccountId>>::withdraw( + let _ = <T::Currency as Currency<T::AccountId>>::withdraw( &transactor, value, WithdrawReasons::TRANSFER, @@ -206,7 +206,8 @@ pub mod pallet { creator: transactor.clone(), }); } else { - <T::Currency as Currency<T::AccountId>>::deposit_into_existing(&dest, value)?; + let _ = + <T::Currency as Currency<T::AccountId>>::deposit_into_existing(&dest, value)?; } OneshotAccounts::<T>::remove(&transactor); Self::deposit_event(Event::OneshotAccountConsumed { @@ -295,7 +296,9 @@ pub mod pallet { creator: transactor.clone(), }); } else { - <T::Currency as Currency<T::AccountId>>::deposit_into_existing(&dest2, balance2)?; + let _ = <T::Currency as Currency<T::AccountId>>::deposit_into_existing( + &dest2, balance2, + )?; } if dest1_is_oneshot { OneshotAccounts::<T>::insert(&dest1, balance1); @@ -305,7 +308,9 @@ pub mod pallet { creator: transactor.clone(), }); } else { - <T::Currency as Currency<T::AccountId>>::deposit_into_existing(&dest1, balance1)?; + let _ = <T::Currency as Currency<T::AccountId>>::deposit_into_existing( + &dest1, balance1, + )?; } OneshotAccounts::<T>::remove(&transactor); Self::deposit_event(Event::OneshotAccountConsumed { diff --git a/pallets/universal-dividend/src/lib.rs b/pallets/universal-dividend/src/lib.rs index 7a446c483..a360fbdf4 100644 --- a/pallets/universal-dividend/src/lib.rs +++ b/pallets/universal-dividend/src/lib.rs @@ -305,7 +305,7 @@ pub mod pallet { core::num::NonZeroU16::new(current_ud_index) .expect("unreachable because current_ud_index is never zero."), ); - T::Currency::deposit_creating(who, uds_total); + let _ = T::Currency::deposit_creating(who, uds_total); Self::deposit_event(Event::UdsClaimed { count: uds_count, total: uds_total, @@ -443,7 +443,7 @@ pub mod pallet { first_ud_index, PastReevals::<T>::get().into_iter(), ); - T::Currency::deposit_creating(who, uds_total); + let _ = T::Currency::deposit_creating(who, uds_total); Self::deposit_event(Event::UdsAutoPaid { count: uds_count, total: uds_total, -- GitLab