Relaxed clippy fixes/nits (#2661)

This PR contains just a few clippy fixes and nits, which are, however,
relaxed by workspace clippy settings here:
https://github.com/paritytech/polkadot-sdk/blob/master/Cargo.toml#L483-L506

---------

Co-authored-by: Dmitry Sinyavin <dmitry.sinyavin@parity.io>
Co-authored-by: ordian <write@reusable.software>
Co-authored-by: command-bot <>
Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
Branislav Kontur
2023-12-18 13:18:30 +01:00
committed by GitHub
parent a250652b3b
commit d941784b39
44 changed files with 76 additions and 106 deletions
@@ -116,7 +116,7 @@ impl<
.map_err(|_| XcmError::NotWithdrawable)
}
fn accrue_checked(checked_account: AccountId, amount: Currency::Balance) {
Currency::deposit_creating(&checked_account, amount);
let _ = Currency::deposit_creating(&checked_account, amount);
Currency::deactivate(amount);
}
fn reduce_checked(checked_account: AccountId, amount: Currency::Balance) {
@@ -218,7 +218,7 @@ impl<
let amount = Matcher::matches_fungible(what).ok_or(Error::AssetNotHandled)?;
let who =
AccountIdConverter::convert_location(who).ok_or(Error::AccountIdConversionFailed)?;
Currency::withdraw(&who, amount, WithdrawReasons::TRANSFER, AllowDeath)
let _ = Currency::withdraw(&who, amount, WithdrawReasons::TRANSFER, AllowDeath)
.map_err(|e| XcmError::FailedToTransactAsset(e.into()))?;
Ok(what.clone().into())
}
+2 -6
View File
@@ -27,20 +27,16 @@ pub use crate::{
};
use frame_support::traits::{ContainsPair, Everything};
pub use frame_support::{
dispatch::{
DispatchInfo, DispatchResultWithPostInfo, GetDispatchInfo, Parameter, PostDispatchInfo,
},
dispatch::{DispatchInfo, DispatchResultWithPostInfo, GetDispatchInfo, PostDispatchInfo},
ensure, match_types, parameter_types,
sp_runtime::{traits::Dispatchable, DispatchError, DispatchErrorWithPostInfo},
traits::{ConstU32, Contains, Get, IsInVec},
traits::{Contains, Get, IsInVec},
};
pub use parity_scale_codec::{Decode, Encode};
pub use sp_io::hashing::blake2_256;
pub use sp_std::{
cell::{Cell, RefCell},
collections::{btree_map::BTreeMap, btree_set::BTreeSet},
fmt::Debug,
marker::PhantomData,
};
pub use xcm::latest::{prelude::*, Weight};
use xcm_executor::traits::{Properties, QueryHandler, QueryResponseStatus};