diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 60968d6600..ed3b67ed1e 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -2387,7 +2387,7 @@ where amount: u128, nesting_budget: &dyn Budget, ) -> DispatchResult { - if T::CrossTokenAddressMapping::is_token_address(&to) { + if T::CrossTokenAddressMapping::is_token_address(to) { return unsupported!(T); } diff --git a/pallets/foreign-assets/src/lib.rs b/pallets/foreign-assets/src/lib.rs index fd8531eea1..46ee92d0d0 100644 --- a/pallets/foreign-assets/src/lib.rs +++ b/pallets/foreign-assets/src/lib.rs @@ -240,9 +240,7 @@ impl Pallet { ) -> Result, XcmError> { let self_location = T::SelfLocation::get(); - if *asset_location == Here.into() { - Ok(Some(NATIVE_FUNGIBLE_COLLECTION_ID)) - } else if *asset_location == self_location { + if *asset_location == Here.into() || *asset_location == self_location { Ok(Some(NATIVE_FUNGIBLE_COLLECTION_ID)) } else if asset_location.parents == self_location.parents { match asset_location @@ -395,7 +393,7 @@ impl Pallet { asset_instance: &AssetInstance, from: T::CrossAccountId, ) -> XcmResult { - let token_id = Self::asset_instance_to_token_id(collection_id, &asset_instance)? + let token_id = Self::asset_instance_to_token_id(collection_id, asset_instance)? .ok_or(XcmError::AssetNotFound)?; if xcm_ext.token_has_children(token_id) { @@ -569,11 +567,11 @@ pub enum ForeignCollectionMode { Fungible(u8), } -impl Into for ForeignCollectionMode { - fn into(self) -> CollectionMode { - match self { - Self::NFT => CollectionMode::NFT, - Self::Fungible(decimals) => CollectionMode::Fungible(decimals), +impl From for CollectionMode { + fn from(value: ForeignCollectionMode) -> Self { + match value { + ForeignCollectionMode::NFT => Self::NFT, + ForeignCollectionMode::Fungible(decimals) => Self::Fungible(decimals), } } } diff --git a/pallets/fungible/src/common.rs b/pallets/fungible/src/common.rs index d585ad8e30..88bb8b79ea 100644 --- a/pallets/fungible/src/common.rs +++ b/pallets/fungible/src/common.rs @@ -470,7 +470,7 @@ impl XcmExtensions for FungibleHandle { up_data_structs::CreateItemData::Fungible(fungible_data) => { >::create_multiple_items( self, - &depositor, + depositor, [(to, fungible_data.value)].into_iter().collect(), nesting_budget, )? @@ -495,7 +495,7 @@ impl XcmExtensions for FungibleHandle { >::FungibleItemsHaveNoId ); - >::transfer_internal(self, &depositor, &from, &to, amount, nesting_budget) + >::transfer_internal(self, depositor, from, to, amount, nesting_budget) .map(|_| ()) .map_err(|post_info| post_info.error) } @@ -506,7 +506,7 @@ impl XcmExtensions for FungibleHandle { token: TokenId, amount: u128, ) -> sp_runtime::DispatchResult { - >::burn_item(&self, from, token, amount) + >::burn_item(self, from, token, amount) .map(|_| ()) .map_err(|post_info| post_info.error) } diff --git a/pallets/nonfungible/src/common.rs b/pallets/nonfungible/src/common.rs index e8dad63fff..9a05ba82d3 100644 --- a/pallets/nonfungible/src/common.rs +++ b/pallets/nonfungible/src/common.rs @@ -585,7 +585,7 @@ impl XcmExtensions for NonfungibleHandle { ) -> Result { >::create_multiple_items( self, - &depositor, + depositor, vec![map_create_data::(data, &to)?], nesting_budget, )?; @@ -604,7 +604,7 @@ impl XcmExtensions for NonfungibleHandle { ) -> sp_runtime::DispatchResult { ensure!(amount == 1, >::NonfungibleItemsHaveNoAmount); - >::transfer_internal(self, &depositor, &from, &to, token, nesting_budget) + >::transfer_internal(self, depositor, from, to, token, nesting_budget) .map(|_| ()) .map_err(|post_info| post_info.error) } diff --git a/runtime/common/config/pallets/foreign_asset.rs b/runtime/common/config/pallets/foreign_asset.rs index 426204e296..60924bdea2 100644 --- a/runtime/common/config/pallets/foreign_asset.rs +++ b/runtime/common/config/pallets/foreign_asset.rs @@ -26,7 +26,7 @@ impl staging_xcm_executor::traits::ConvertLocation { fn convert_location(location: &MultiLocation) -> Option { LocationToAccountId::convert_location(location) - .map(|sub| ConfigCrossAccountId::from_sub(sub)) + .map(ConfigCrossAccountId::from_sub) .or_else(|| { let eth_address = AccountKey20Aliases::::convert_location(location)?;