From 334927b2e0c494853bd0b62abbd389841abd1c33 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Thu, 02 Jun 2022 13:04:49 +0000 Subject: [PATCH] refactorprimitives): purge defaultness from rmrk --- --- a/primitives/data-structs/src/rmrk.rs +++ b/primitives/data-structs/src/rmrk.rs @@ -1,8 +1,6 @@ use codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; -use derivative::Derivative; - #[cfg(feature = "std")] use serde::Serialize; @@ -147,7 +145,7 @@ pub value: BoundedValue, } -#[derive(Encode, Decode, Default, Eq, PartialEq, Clone, Debug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Eq, PartialEq, Clone, Debug, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "std", derive(Serialize))] #[cfg_attr(feature = "std", serde(bound = "BoundedString: AsRef<[u8]>"))] pub struct BasicResource { @@ -260,7 +258,7 @@ pub thumb: Option, } -#[derive(Encode, Decode, Derivative, Eq, PartialEq, Clone, Debug, TypeInfo, MaxEncodedLen)] +#[derive(Encode, Decode, Eq, PartialEq, Clone, Debug, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "std", derive(Serialize))] #[cfg_attr( feature = "std", @@ -269,9 +267,7 @@ BoundedParts: AsRef<[PartId]> "#) )] -#[derivative(Default(bound = ""))] -pub enum ResourceTypes { - #[derivative(Default)] +pub enum ResourceTypes { Basic(BasicResource), Composable(ComposableResource), Slot(SlotResource), @@ -286,7 +282,7 @@ BoundedParts: AsRef<[PartId]> "#) )] -pub struct ResourceInfo { +pub struct ResourceInfo { /// id is a 5-character string of reasonable uniqueness. /// The combination of base ID and resource id should be unique across the entire RMRK /// ecosystem which @@ -337,18 +333,14 @@ } #[cfg_attr(feature = "std", derive(Serialize))] -#[derive(Encode, Decode, Debug, Derivative, TypeInfo, Clone, PartialEq, Eq, MaxEncodedLen)] +#[derive(Encode, Decode, Debug, TypeInfo, Clone, PartialEq, Eq, MaxEncodedLen)] #[cfg_attr( feature = "std", serde(bound = "BoundedCollectionList: AsRef<[CollectionId]>") )] -#[derivative(Default(bound = ""))] pub enum EquippableList { All, - - #[derivative(Default)] Empty, - Custom(#[cfg_attr(feature = "std", serde(with = "serialize::vec"))] BoundedCollectionList), } -- gitstuff