difftreelog
fix clippy
in: master
5 files changed
pallets/common/src/lib.rsdiffbeforeafterboth--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -2387,7 +2387,7 @@
amount: u128,
nesting_budget: &dyn Budget,
) -> DispatchResult {
- if T::CrossTokenAddressMapping::is_token_address(&to) {
+ if T::CrossTokenAddressMapping::is_token_address(to) {
return unsupported!(T);
}
pallets/foreign-assets/src/lib.rsdiffbeforeafterboth240 ) -> Result<Option<CollectionId>, XcmError> {240 ) -> Result<Option<CollectionId>, XcmError> {241 let self_location = T::SelfLocation::get();241 let self_location = T::SelfLocation::get();242242243 if *asset_location == Here.into() {243 if *asset_location == Here.into() || *asset_location == self_location {244 Ok(Some(NATIVE_FUNGIBLE_COLLECTION_ID))245 } else if *asset_location == self_location {246 Ok(Some(NATIVE_FUNGIBLE_COLLECTION_ID))244 Ok(Some(NATIVE_FUNGIBLE_COLLECTION_ID))247 } else if asset_location.parents == self_location.parents {245 } else if asset_location.parents == self_location.parents {248 match asset_location246 match asset_location395 asset_instance: &AssetInstance,393 asset_instance: &AssetInstance,396 from: T::CrossAccountId,394 from: T::CrossAccountId,397 ) -> XcmResult {395 ) -> XcmResult {398 let token_id = Self::asset_instance_to_token_id(collection_id, &asset_instance)?396 let token_id = Self::asset_instance_to_token_id(collection_id, asset_instance)?399 .ok_or(XcmError::AssetNotFound)?;397 .ok_or(XcmError::AssetNotFound)?;400398401 if xcm_ext.token_has_children(token_id) {399 if xcm_ext.token_has_children(token_id) {569 Fungible(u8),567 Fungible(u8),570}568}571569572impl Into<CollectionMode> for ForeignCollectionMode {570impl From<ForeignCollectionMode> for CollectionMode {573 fn into(self) -> CollectionMode {571 fn from(value: ForeignCollectionMode) -> Self {574 match self {572 match value {575 Self::NFT => CollectionMode::NFT,573 ForeignCollectionMode::NFT => Self::NFT,576 Self::Fungible(decimals) => CollectionMode::Fungible(decimals),574 ForeignCollectionMode::Fungible(decimals) => Self::Fungible(decimals),577 }575 }578 }576 }579}577}pallets/fungible/src/common.rsdiffbeforeafterboth--- a/pallets/fungible/src/common.rs
+++ b/pallets/fungible/src/common.rs
@@ -470,7 +470,7 @@
up_data_structs::CreateItemData::Fungible(fungible_data) => {
<Pallet<T>>::create_multiple_items(
self,
- &depositor,
+ depositor,
[(to, fungible_data.value)].into_iter().collect(),
nesting_budget,
)?
@@ -495,7 +495,7 @@
<CommonError<T>>::FungibleItemsHaveNoId
);
- <Pallet<T>>::transfer_internal(self, &depositor, &from, &to, amount, nesting_budget)
+ <Pallet<T>>::transfer_internal(self, depositor, from, to, amount, nesting_budget)
.map(|_| ())
.map_err(|post_info| post_info.error)
}
@@ -506,7 +506,7 @@
token: TokenId,
amount: u128,
) -> sp_runtime::DispatchResult {
- <Self as CommonCollectionOperations<T>>::burn_item(&self, from, token, amount)
+ <Self as CommonCollectionOperations<T>>::burn_item(self, from, token, amount)
.map(|_| ())
.map_err(|post_info| post_info.error)
}
pallets/nonfungible/src/common.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/common.rs
+++ b/pallets/nonfungible/src/common.rs
@@ -585,7 +585,7 @@
) -> Result<TokenId, sp_runtime::DispatchError> {
<Pallet<T>>::create_multiple_items(
self,
- &depositor,
+ depositor,
vec![map_create_data::<T>(data, &to)?],
nesting_budget,
)?;
@@ -604,7 +604,7 @@
) -> sp_runtime::DispatchResult {
ensure!(amount == 1, <Error<T>>::NonfungibleItemsHaveNoAmount);
- <Pallet<T>>::transfer_internal(self, &depositor, &from, &to, token, nesting_budget)
+ <Pallet<T>>::transfer_internal(self, depositor, from, to, token, nesting_budget)
.map(|_| ())
.map_err(|post_info| post_info.error)
}
runtime/common/config/pallets/foreign_asset.rsdiffbeforeafterboth--- a/runtime/common/config/pallets/foreign_asset.rs
+++ b/runtime/common/config/pallets/foreign_asset.rs
@@ -26,7 +26,7 @@
{
fn convert_location(location: &MultiLocation) -> Option<ConfigCrossAccountId> {
LocationToAccountId::convert_location(location)
- .map(|sub| ConfigCrossAccountId::from_sub(sub))
+ .map(ConfigCrossAccountId::from_sub)
.or_else(|| {
let eth_address =
AccountKey20Aliases::<RelayNetwork, H160>::convert_location(location)?;