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:
Koute
2023-05-23 20:34:04 +09:00
committed by GitHub
parent 06865d4c08
commit 194c9edd4a
13 changed files with 223 additions and 187 deletions
@@ -21,7 +21,7 @@ use super::*;
impl<T: Config<I>, I: 'static> StoredMap<(T::AssetId, T::AccountId), T::Extra> for Pallet<T, I> {
fn get(id_who: &(T::AssetId, T::AccountId)) -> T::Extra {
let &(id, ref who) = id_who;
let (id, who) = id_who;
Account::<T, I>::get(id, who).map(|a| a.extra).unwrap_or_default()
}
@@ -29,7 +29,7 @@ impl<T: Config<I>, I: 'static> StoredMap<(T::AssetId, T::AccountId), T::Extra> f
id_who: &(T::AssetId, T::AccountId),
f: impl FnOnce(&mut Option<T::Extra>) -> Result<R, E>,
) -> Result<R, E> {
let &(id, ref who) = id_who;
let (id, who) = id_who;
let mut maybe_extra = Account::<T, I>::get(id, who).map(|a| a.extra);
let r = f(&mut maybe_extra)?;
// They want to write some value or delete it.