mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-17 21:45:41 +00:00
[fix lint warnings: NFTs pallet] fix clippy::missing_errors_doc lint warnings (#14648)
* fix missing errors doc warnings * cargo +nightly fmt * Update frame/nfts/src/features/create_delete_item.rs * Update frame/nfts/src/features/create_delete_item.rs * Update frame/nfts/src/features/transfer.rs * Update frame/nfts/src/features/create_delete_collection.rs * add intra doc linking for errors * fmt * Apply suggestions from code review Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> --------- Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
@@ -381,14 +381,24 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
/// A helper method to construct attribute's key.
|
||||
/// A helper method to construct an attribute's key.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// This function returns an [`IncorrectData`](crate::Error::IncorrectData) error if the
|
||||
/// provided attribute `key` is too long.
|
||||
pub fn construct_attribute_key(
|
||||
key: Vec<u8>,
|
||||
) -> Result<BoundedVec<u8, T::KeyLimit>, DispatchError> {
|
||||
Ok(BoundedVec::try_from(key).map_err(|_| Error::<T, I>::IncorrectData)?)
|
||||
}
|
||||
|
||||
/// A helper method to construct attribute's value.
|
||||
/// A helper method to construct an attribute's value.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// This function returns an [`IncorrectData`](crate::Error::IncorrectData) error if the
|
||||
/// provided `value` is too long.
|
||||
pub fn construct_attribute_value(
|
||||
value: Vec<u8>,
|
||||
) -> Result<BoundedVec<u8, T::ValueLimit>, DispatchError> {
|
||||
@@ -396,6 +406,11 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
}
|
||||
|
||||
/// A helper method to check whether a system attribute is set for a given item.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// This function returns an [`IncorrectData`](crate::Error::IncorrectData) error if the
|
||||
/// provided pallet attribute is too long.
|
||||
pub fn has_system_attribute(
|
||||
collection: &T::CollectionId,
|
||||
item: &T::ItemId,
|
||||
|
||||
Reference in New Issue
Block a user