From 717e109aae0c82ca22e213987a6cc8e487ba590e Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Fri, 22 Jul 2022 13:25:11 +0000 Subject: [PATCH] doc(rmrk): requested clarifications --- --- a/pallets/proxy-rmrk-core/src/lib.rs +++ b/pallets/proxy-rmrk-core/src/lib.rs @@ -113,7 +113,7 @@ //! is an unacceptable symbol in user-defined properties, which, along with other safeguards, //! makes them impossible to tamper with. //! -//! ### Collection and NFT Types, and Base, Parts and Themes Handling +//! ### Collection and NFT Types, or Base, Parts and Themes Handling //! //! RMRK introduces the concept of a Base, which is a catalogue of Parts, //! possible components of an NFT. Due to its similarity with the functionality --- a/pallets/proxy-rmrk-core/src/misc.rs +++ b/pallets/proxy-rmrk-core/src/misc.rs @@ -20,7 +20,7 @@ use codec::{Encode, Decode, Error}; /// Match errors from one type to another and return an error -/// if a match is successful. +/// if a match is successful. This macro expects a pattern matcher #[macro_export] macro_rules! map_unique_err_to_proxy { (match $err:ident { $($unique_err_ty:ident :: $unique_err:ident => $proxy_err:ident),+ $(,)? }) => { @@ -34,9 +34,10 @@ }; } -/// Interface to decode bytes from a bounded vector into an arbitrary type. +/// Interface to decode some serialized bytes into an arbitrary type `T`, +/// preferably if these bytes were originally encoded from `T`. pub trait RmrkDecode { - /// Try to decode bytes from a bounded vector into an arbitrary type. + /// Try to decode self into an arbitrary type `T`. fn decode(&self) -> Result; } @@ -48,7 +49,7 @@ } } -/// Interface to "rebind", change the limit of a bounded byte vector. +/// Interface to "rebind" - change the limit of a bounded byte vector. pub trait RmrkRebind { /// Try to change the limit of a bounded byte vector. fn rebind(&self) -> Result, Error>; --- a/pallets/proxy-rmrk-equip/src/lib.rs +++ b/pallets/proxy-rmrk-equip/src/lib.rs @@ -116,7 +116,7 @@ //! is an unacceptable symbol in user-defined properties, which, along with other safeguards, //! makes them impossible to tamper with. //! -//! ### Collection and NFT Types, and Base, Parts and Themes Handling +//! ### Collection and NFT Types, or Base, Parts and Themes Handling //! //! RMRK introduces the concept of a Base, which is a catalogue of Parts, //! possible components of an NFT. Due to its similarity with the functionality @@ -414,7 +414,8 @@ } impl Pallet { - /// Create or renew an NFT serving as a Part inside a collection serving as a Base. + /// Create (or overwrite) a Part in a Base. + /// The Part and the Base are represented as an NFT and a Collection. fn create_part( sender: &T::CrossAccountId, collection: &NonfungibleHandle, -- gitstuff