mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 11:21:07 +00:00
Remove the Copy bound on AssetId (#14158)
* Remove the `Copy` bound on `AssetId` * Also relax the `Copy` bound in the assets pallet * Fix warnings on the newest nightly Rust * Remove some unnecessary `clone()`s * Try to satisfy clippy * Remove some more unnecessary `clone()`s * Add more `.clone()`s for newly merged code * Also add `clone()`s in the benchmarks --------- Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -161,10 +161,10 @@ pub mod pallet {
|
||||
T::CreateOrigin::ensure_origin(origin)?;
|
||||
|
||||
ensure!(
|
||||
!ConversionRateToNative::<T>::contains_key(asset_id),
|
||||
!ConversionRateToNative::<T>::contains_key(asset_id.clone()),
|
||||
Error::<T>::AlreadyExists
|
||||
);
|
||||
ConversionRateToNative::<T>::set(asset_id, Some(rate));
|
||||
ConversionRateToNative::<T>::set(asset_id.clone(), Some(rate));
|
||||
|
||||
Self::deposit_event(Event::AssetRateCreated { asset_id, rate });
|
||||
Ok(())
|
||||
@@ -184,7 +184,7 @@ pub mod pallet {
|
||||
T::UpdateOrigin::ensure_origin(origin)?;
|
||||
|
||||
let mut old = FixedU128::zero();
|
||||
ConversionRateToNative::<T>::mutate(asset_id, |maybe_rate| {
|
||||
ConversionRateToNative::<T>::mutate(asset_id.clone(), |maybe_rate| {
|
||||
if let Some(r) = maybe_rate {
|
||||
old = *r;
|
||||
*r = rate;
|
||||
@@ -209,10 +209,10 @@ pub mod pallet {
|
||||
T::RemoveOrigin::ensure_origin(origin)?;
|
||||
|
||||
ensure!(
|
||||
ConversionRateToNative::<T>::contains_key(asset_id),
|
||||
ConversionRateToNative::<T>::contains_key(asset_id.clone()),
|
||||
Error::<T>::UnknownAssetId
|
||||
);
|
||||
ConversionRateToNative::<T>::remove(asset_id);
|
||||
ConversionRateToNative::<T>::remove(asset_id.clone());
|
||||
|
||||
Self::deposit_event(Event::AssetRateRemoved { asset_id });
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user