From 7f1f404622bbe292267dbfc5b8ec015683ae3e19 Mon Sep 17 00:00:00 2001 From: Ranadeep Biswas Date: Tue, 26 Nov 2024 12:54:07 +0100 Subject: [PATCH] cargo clippy --- ibc-core/ics04-channel/types/src/packet.rs | 2 +- ibc-core/ics24-host/types/src/identifiers/chain_id.rs | 2 +- ibc-core/ics26-routing/src/module.rs | 2 -- ibc-primitives/src/utils/pretty.rs | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ibc-core/ics04-channel/types/src/packet.rs b/ibc-core/ics04-channel/types/src/packet.rs index e5f2e8779..82b28a1fd 100644 --- a/ibc-core/ics04-channel/types/src/packet.rs +++ b/ibc-core/ics04-channel/types/src/packet.rs @@ -100,7 +100,7 @@ pub struct Packet { struct PacketData<'a>(&'a [u8]); -impl<'a> core::fmt::Debug for PacketData<'a> { +impl core::fmt::Debug for PacketData<'_> { fn fmt(&self, formatter: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> { write!(formatter, "{:?}", self.0) } diff --git a/ibc-core/ics24-host/types/src/identifiers/chain_id.rs b/ibc-core/ics24-host/types/src/identifiers/chain_id.rs index c96ccc36f..1a6f1b02a 100644 --- a/ibc-core/ics24-host/types/src/identifiers/chain_id.rs +++ b/ibc-core/ics24-host/types/src/identifiers/chain_id.rs @@ -135,7 +135,7 @@ impl<'de> Deserialize<'de> for ChainId { { struct FieldVisitor; - impl<'de> Visitor<'de> for FieldVisitor { + impl Visitor<'_> for FieldVisitor { type Value = Field; fn expecting(&self, formatter: &mut Formatter<'_>) -> core::fmt::Result { diff --git a/ibc-core/ics26-routing/src/module.rs b/ibc-core/ics26-routing/src/module.rs index a0877b98d..a73d4f639 100644 --- a/ibc-core/ics26-routing/src/module.rs +++ b/ibc-core/ics26-routing/src/module.rs @@ -144,7 +144,6 @@ pub trait Module: Debug { ) -> (ModuleExtras, Result<(), ChannelError>); /// Note: `MsgTimeout` and `MsgTimeoutOnClose` use the same callback - fn on_timeout_packet_validate( &self, packet: &Packet, @@ -152,7 +151,6 @@ pub trait Module: Debug { ) -> Result<(), ChannelError>; /// Note: `MsgTimeout` and `MsgTimeoutOnClose` use the same callback - fn on_timeout_packet_execute( &mut self, packet: &Packet, diff --git a/ibc-primitives/src/utils/pretty.rs b/ibc-primitives/src/utils/pretty.rs index 6f59efdbf..75ea3676c 100644 --- a/ibc-primitives/src/utils/pretty.rs +++ b/ibc-primitives/src/utils/pretty.rs @@ -5,7 +5,7 @@ use core::fmt::{Display, Error as FmtError, Formatter}; /// A slice type that implements the `Display` trait to pretty-print the contained elements. pub struct PrettySlice<'a, T>(pub &'a [T]); -impl<'a, T: Display> Display for PrettySlice<'a, T> { +impl Display for PrettySlice<'_, T> { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!(f, "[ ")?; let mut vec_iterator = self.0.iter().peekable();