From 82165daa2c1094940af0202570b92fcacec7aecc Mon Sep 17 00:00:00 2001 From: yito88 Date: Thu, 18 Jan 2024 17:26:58 +0100 Subject: [PATCH] fmt and clippy --- ibc-apps/ics721-nft-transfer/src/context.rs | 4 ++-- ibc-apps/ics721-nft-transfer/types/src/data.rs | 4 +--- ibc-apps/ics721-nft-transfer/types/src/packet.rs | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ibc-apps/ics721-nft-transfer/src/context.rs b/ibc-apps/ics721-nft-transfer/src/context.rs index 84d782e1d..81dda2f87 100644 --- a/ibc-apps/ics721-nft-transfer/src/context.rs +++ b/ibc-apps/ics721-nft-transfer/src/context.rs @@ -50,7 +50,7 @@ pub trait NftTransferValidationContext { fn can_receive_nft(&self) -> Result<(), NftTransferError>; /// Validates that the NFT can be created or updated successfully. - /// + /// /// Note: some existing ICS-721 implementations may not strictly adhere to /// the ICS-721 class data structure. The /// [`ClassData`](crate::types::ClassData) associated with this @@ -90,7 +90,7 @@ pub trait NftTransferValidationContext { ) -> Result<(), NftTransferError>; /// Validates the receiver account and the NFT input - /// + /// /// Note: some existing ICS-721 implementations may not strictly adhere to /// the ICS-721 token data structure. The /// [`TokenData`](crate::types::TokenData) associated with this diff --git a/ibc-apps/ics721-nft-transfer/types/src/data.rs b/ibc-apps/ics721-nft-transfer/types/src/data.rs index d7e98c640..8a7de5d4e 100644 --- a/ibc-apps/ics721-nft-transfer/types/src/data.rs +++ b/ibc-apps/ics721-nft-transfer/types/src/data.rs @@ -26,8 +26,7 @@ pub struct Data(String); impl Data { /// Parses the data in the format specified by ICS-721. - pub fn parse_as_ics721_data(&self) -> Result - { + pub fn parse_as_ics721_data(&self) -> Result { self.0.parse::() } } @@ -63,7 +62,6 @@ impl FromStr for Data { #[derive(Clone, Debug, Default, PartialEq, Eq)] pub struct Ics721Data(BTreeMap); - impl FromStr for Ics721Data { type Err = NftTransferError; diff --git a/ibc-apps/ics721-nft-transfer/types/src/packet.rs b/ibc-apps/ics721-nft-transfer/types/src/packet.rs index 398552347..6ced166e5 100644 --- a/ibc-apps/ics721-nft-transfer/types/src/packet.rs +++ b/ibc-apps/ics721-nft-transfer/types/src/packet.rs @@ -230,7 +230,7 @@ mod tests { assert!(data.as_ref().parse_as_ics721_data().is_ok()); }; - if deser.token_data.len() > 0 { + if !deser.token_data.is_empty() { for data in deser.token_data.iter() { assert!(data.as_ref().parse_as_ics721_data().is_ok()); }