diff --git a/pallets/nft/src/impl_nonfungibles.rs b/pallets/nft/src/impl_nonfungibles.rs index dd4725d..2f124f8 100644 --- a/pallets/nft/src/impl_nonfungibles.rs +++ b/pallets/nft/src/impl_nonfungibles.rs @@ -1,10 +1,7 @@ - //! Implementations for `nonfungibles` traits. use super::*; -use frame_support::{ - traits::tokens::nonfungibles::{Inspect, Transfer}, -}; +use frame_support::traits::tokens::nonfungibles::{Inspect, Transfer}; use sp_runtime::DispatchResult; impl Inspect<::AccountId> for Pallet { @@ -15,7 +12,7 @@ impl Inspect<::AccountId> for Pallet { class: &Self::ClassId, instance: &Self::InstanceId, ) -> Option<::AccountId> { - orml_nft::Pallet::::tokens(class, instance).map(|a| a.owner) + orml_nft::Pallet::::tokens(class, instance).map(|a| a.owner) } fn class_owner(class: &Self::ClassId) -> Option<::AccountId> { @@ -48,9 +45,9 @@ impl Inspect<::AccountId> for Pallet { fn class_attribute(class: &Self::ClassId, key: &[u8]) -> Option> { if key.is_empty() { // We make the empty key map to the instance metadata value. - orml_nft::Pallet::::classes(class).map(|a| a.metadata.into()) + orml_nft::Pallet::::classes(class).map(|a| a.metadata.into()) } else { - return None + return None } } @@ -58,10 +55,10 @@ impl Inspect<::AccountId> for Pallet { /// /// Default implementation is that all assets are transferable. fn can_transfer(class: &Self::ClassId, instance: &Self::InstanceId) -> bool { - match orml_nft::Pallet::::classes(class) { - Some(class) => class.data.properties.0.contains(ClassProperty::Transferable), - _ => false, - } + match orml_nft::Pallet::::classes(class) { + Some(class) => class.data.properties.0.contains(ClassProperty::Transferable), + _ => false, + } } } @@ -71,8 +68,10 @@ impl Transfer for Pallet { instance: &Self::InstanceId, destination: &T::AccountId, ) -> DispatchResult { - let from = orml_nft::Pallet::::tokens(class, instance).map(|a| a.owner).ok_or(Error::::TokenIdNotFound)?; + let from = orml_nft::Pallet::::tokens(class, instance) + .map(|a| a.owner) + .ok_or(Error::::TokenIdNotFound)?; Self::do_transfer(&from, &destination, (*class, *instance))?; - Ok(()) + Ok(()) } }