From 761b2c7920ca66e0bf2872d66c30630e6cc91cb0 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 06 May 2022 14:47:31 +0000 Subject: [PATCH] cargo fmt --- --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -844,30 +844,31 @@ Ok(()) } - pub fn bytes_keys_to_property_keys(keys: Vec>) -> Result, DispatchError> { + pub fn bytes_keys_to_property_keys( + keys: Vec>, + ) -> Result, DispatchError> { keys.into_iter() .map(|key| -> Result { // TODO Fix error - key.try_into().map_err(|_| DispatchError::Other("Can't read property key")) + key.try_into() + .map_err(|_| DispatchError::Other("Can't read property key")) }) .collect::, DispatchError>>() } pub fn filter_collection_properties( collection_id: CollectionId, - keys: Vec + keys: Vec, ) -> Result, DispatchError> { let properties = Self::collection_properties(collection_id); - let properties = keys.into_iter() + let properties = keys + .into_iter() .filter_map(|key| { - properties.get_property(&key) - .map(|value| { - Property { - key, - value: value.clone() - } - }) + properties.get_property(&key).map(|value| Property { + key, + value: value.clone(), + }) }) .collect(); @@ -876,18 +877,18 @@ pub fn filter_property_permissions( collection_id: CollectionId, - keys: Vec + keys: Vec, ) -> Result, DispatchError> { let permissions = Self::property_permissions(collection_id); - let key_permissions = keys.into_iter() + let key_permissions = keys + .into_iter() .filter_map(|key| { - permissions.get(&key) - .map(|permission| { - PropertyKeyPermission { - key, - permission: permission.clone() - } + permissions + .get(&key) + .map(|permission| PropertyKeyPermission { + key, + permission: permission.clone(), }) }) .collect(); @@ -1169,11 +1170,7 @@ fn token_owner(&self, token: TokenId) -> Option; fn const_metadata(&self, token: TokenId) -> Vec; fn variable_metadata(&self, token: TokenId) -> Vec; - fn token_properties( - &self, - token_id: TokenId, - keys: Vec - ) -> Vec; + fn token_properties(&self, token_id: TokenId, keys: Vec) -> Vec; /// Amount of unique collection tokens fn total_supply(&self) -> u32; /// Amount of different tokens account has (Applicable to nonfungible/refungible) --- a/pallets/fungible/src/common.rs +++ b/pallets/fungible/src/common.rs @@ -336,11 +336,7 @@ Vec::new() } - fn token_properties( - &self, - _token_id: TokenId, - _keys: Vec - ) -> Vec { + fn token_properties(&self, _token_id: TokenId, _keys: Vec) -> Vec { Vec::new() } --- a/pallets/nonfungible/src/common.rs +++ b/pallets/nonfungible/src/common.rs @@ -386,22 +386,15 @@ .into_inner() } - fn token_properties( - &self, - token_id: TokenId, - keys: Vec - ) -> Vec { + fn token_properties(&self, token_id: TokenId, keys: Vec) -> Vec { let properties = >::token_properties((self.id, token_id)); keys.into_iter() .filter_map(|key| { - properties.get_property(&key) - .map(|value| { - Property { - key, - value: value.clone() - } - }) + properties.get_property(&key).map(|value| Property { + key, + value: value.clone(), + }) }) .collect() } --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -363,11 +363,7 @@ .into_inner() } - fn token_properties( - &self, - _token_id: TokenId, - _keys: Vec - ) -> Vec { + fn token_properties(&self, _token_id: TokenId, _keys: Vec) -> Vec { Vec::new() } -- gitstuff