Skip to content

Commit

Permalink
Cargo clippy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ljoss17 authored and romac committed Dec 13, 2024
1 parent 37bcece commit d2fb99a
Show file tree
Hide file tree
Showing 34 changed files with 80 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ where

struct StringOrInt;

impl<'de> Visitor<'de> for StringOrInt {
impl Visitor<'_> for StringOrInt {
type Value = u64;

fn expecting(&self, formatter: &mut Formatter<'_>) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion crates/relayer-types/src/core/ics04_channel/packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,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)
}
Expand Down
4 changes: 2 additions & 2 deletions crates/relayer-types/src/utils/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl Display for PrettyDuration<'_> {

pub struct PrettyOption<'a, T>(pub &'a Option<T>);

impl<'a, T: Display> Display for PrettyOption<'a, T> {
impl<T: Display> Display for PrettyOption<'_, T> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> {
match &self.0 {
Some(v) => write!(f, "{v}"),
Expand Down Expand Up @@ -62,7 +62,7 @@ impl Display for PrettyValidatorSet<'_> {

pub struct PrettySlice<'a, T>(pub &'a [T]);

impl<'a, T: Display> Display for PrettySlice<'a, T> {
impl<T: Display> Display for PrettySlice<'_, T> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> {
write!(f, "[ ")?;
let mut vec_iterator = self.0.iter().peekable();
Expand Down
6 changes: 3 additions & 3 deletions crates/relayer/src/config/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl Serialize for ChannelFilters {
b: &'a FilterPattern<ChannelId>,
}

impl<'a> Serialize for Pair<'a> {
impl Serialize for Pair<'_> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand Down Expand Up @@ -378,7 +378,7 @@ pub(crate) mod port {

pub struct PortFilterMatchVisitor;

impl<'de> de::Visitor<'de> for PortFilterMatchVisitor {
impl de::Visitor<'_> for PortFilterMatchVisitor {
type Value = PortFilterMatch;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down Expand Up @@ -407,7 +407,7 @@ pub(crate) mod channel {

pub struct ChannelFilterMatchVisitor;

impl<'de> de::Visitor<'de> for ChannelFilterMatchVisitor {
impl de::Visitor<'_> for ChannelFilterMatchVisitor {
type Value = ChannelFilterMatch;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion crates/relayer/src/config/proof_specs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub fn serialize<S: Serializer>(

struct ProofSpecsVisitor;

impl<'de> de::Visitor<'de> for ProofSpecsVisitor {
impl de::Visitor<'_> for ProofSpecsVisitor {
type Value = Option<ProofSpecs>;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down
8 changes: 4 additions & 4 deletions crates/relayer/src/util/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::event::IbcEventWithHeight;

pub struct PrettyAny<'a>(pub &'a Any);

impl<'a> Display for PrettyAny<'a> {
impl Display for PrettyAny<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> {
write!(f, "Any {{ type_url: {} }}", self.0.type_url)
}
Expand Down Expand Up @@ -97,7 +97,7 @@ impl Display for PrettyDuration<'_> {
/// For use in debug messages
pub struct PrettyEvents<'a>(pub &'a [IbcEventWithHeight]);

impl<'a> Display for PrettyEvents<'a> {
impl Display for PrettyEvents<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> {
writeln!(f, "events:")?;
for v in self.0 {
Expand Down Expand Up @@ -180,7 +180,7 @@ impl Display for PrettyIdentifiedConnection<'_> {

pub struct PrettyOption<'a, T>(pub &'a Option<T>);

impl<'a, T: Display> Display for PrettyOption<'a, T> {
impl<T: Display> Display for PrettyOption<'_, T> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> {
match &self.0 {
Some(v) => write!(f, "{v}"),
Expand All @@ -191,7 +191,7 @@ impl<'a, T: Display> Display for PrettyOption<'a, T> {

pub struct PrettySlice<'a, T>(pub &'a [T]);

impl<'a, T: Display> Display for PrettySlice<'a, T> {
impl<T: Display> Display for PrettySlice<'_, T> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> {
write!(f, "[ ")?;
let mut vec_iterator = self.0.iter().peekable();
Expand Down
2 changes: 1 addition & 1 deletion tools/test-framework/src/chain/ext/async_icq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub trait AsyncIcqMethodsExt<Chain> {
fn async_icq(&self, channel_id: &ChannelId, query_json: &str, from: &str) -> Result<(), Error>;
}

impl<'a, Chain: Send> AsyncIcqMethodsExt<Chain> for MonoTagged<Chain, &'a ChainDriver> {
impl<Chain: Send> AsyncIcqMethodsExt<Chain> for MonoTagged<Chain, &ChainDriver> {
fn update_oracle(&self, relayer: &str, fees: &str, init_args: &str) -> Result<(), Error> {
let driver = *self.value();

Expand Down
2 changes: 1 addition & 1 deletion tools/test-framework/src/chain/ext/authz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub trait AuthzMethodsExt<Chain> {
) -> Result<(), Error>;
}

impl<'a, Chain: Send> AuthzMethodsExt<Chain> for MonoTagged<Chain, &'a ChainDriver> {
impl<Chain: Send> AuthzMethodsExt<Chain> for MonoTagged<Chain, &ChainDriver> {
fn authz_grant(
&self,
granter: &str,
Expand Down
2 changes: 1 addition & 1 deletion tools/test-framework/src/chain/ext/crosschainquery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub trait CrossChainQueryMethodsExt<Chain> {
fn assert_processed_cross_chain_query(&self) -> Result<(), Error>;
}

impl<'a, Chain: Send> CrossChainQueryMethodsExt<Chain> for MonoTagged<Chain, &'a ChainDriver> {
impl<Chain: Send> CrossChainQueryMethodsExt<Chain> for MonoTagged<Chain, &ChainDriver> {
fn assert_pending_cross_chain_query(&self) -> Result<(), Error> {
assert_eventually_succeed(
"waiting for a cross chain query request",
Expand Down
2 changes: 1 addition & 1 deletion tools/test-framework/src/chain/ext/fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub trait ChainFeeMethodsExt<Chain> {
) -> Result<Vec<IdentifiedPacketFees>, Error>;
}

impl<'a, Chain: Send> ChainFeeMethodsExt<Chain> for MonoTagged<Chain, &'a ChainDriver> {
impl<Chain: Send> ChainFeeMethodsExt<Chain> for MonoTagged<Chain, &ChainDriver> {
fn ibc_token_transfer_with_fee<Counterparty>(
&self,
port_id: &TaggedPortIdRef<'_, Chain, Counterparty>,
Expand Down
2 changes: 1 addition & 1 deletion tools/test-framework/src/chain/ext/fee_grant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub trait FeeGrantMethodsExt<Chain> {
) -> Result<(), Error>;
}

impl<'a, Chain: Send> FeeGrantMethodsExt<Chain> for MonoTagged<Chain, &'a ChainDriver> {
impl<Chain: Send> FeeGrantMethodsExt<Chain> for MonoTagged<Chain, &ChainDriver> {
fn feegrant_grant(
&self,
granter: &str,
Expand Down
2 changes: 1 addition & 1 deletion tools/test-framework/src/chain/ext/ica.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub trait InterchainAccountMethodsExt<Chain> {
) -> Result<MonoTagged<Counterparty, WalletAddress>, Error>;
}

impl<'a, Chain: Send> InterchainAccountMethodsExt<Chain> for MonoTagged<Chain, &'a ChainDriver> {
impl<Chain: Send> InterchainAccountMethodsExt<Chain> for MonoTagged<Chain, &ChainDriver> {
fn register_interchain_account_cli<Counterparty>(
&self,
from: &MonoTagged<Chain, &WalletAddress>,
Expand Down
2 changes: 1 addition & 1 deletion tools/test-framework/src/chain/ext/proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub trait ChainProposalMethodsExt {
) -> Result<(), Error>;
}

impl<'a, Chain: Send> ChainProposalMethodsExt for MonoTagged<Chain, &'a ChainDriver> {
impl<Chain: Send> ChainProposalMethodsExt for MonoTagged<Chain, &ChainDriver> {
fn query_upgrade_proposal_height(
&self,
grpc_address: &Uri,
Expand Down
2 changes: 1 addition & 1 deletion tools/test-framework/src/chain/ext/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub trait ChainTransferMethodsExt<Chain> {
) -> Result<(), Error>;
}

impl<'a, Chain: Send> ChainTransferMethodsExt<Chain> for MonoTagged<Chain, &'a ChainDriver> {
impl<Chain: Send> ChainTransferMethodsExt<Chain> for MonoTagged<Chain, &ChainDriver> {
fn ibc_transfer_token<Counterparty>(
&self,
port_id: &TaggedPortIdRef<Chain, Counterparty>,
Expand Down
2 changes: 1 addition & 1 deletion tools/test-framework/src/chain/ext/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub trait ChainVersionMethodsExt {
fn major_version(&self) -> Result<u64, Error>;
}

impl<'a, Chain: Send> ChainVersionMethodsExt for MonoTagged<Chain, &'a ChainDriver> {
impl<Chain: Send> ChainVersionMethodsExt for MonoTagged<Chain, &ChainDriver> {
fn major_version(&self) -> Result<u64, Error> {
major_version(&self.value().command_path)
}
Expand Down
2 changes: 1 addition & 1 deletion tools/test-framework/src/chain/ext/wasm_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub trait StoreWasmClientCodeMethodsExt {
) -> Result<String, Error>;
}

impl<'a, Chain: Send> StoreWasmClientCodeMethodsExt for MonoTagged<Chain, &'a ChainDriver> {
impl<Chain: Send> StoreWasmClientCodeMethodsExt for MonoTagged<Chain, &ChainDriver> {
fn store_wasm_client_code(
&self,
wasm_path: &Path,
Expand Down
2 changes: 1 addition & 1 deletion tools/test-framework/src/chain/tagged.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub trait TaggedChainDriverExt<Chain> {
fn query_auth_module(&self, module_name: &str) -> Result<String, Error>;
}

impl<'a, Chain: Send> TaggedChainDriverExt<Chain> for MonoTagged<Chain, &'a ChainDriver> {
impl<Chain: Send> TaggedChainDriverExt<Chain> for MonoTagged<Chain, &ChainDriver> {
fn chain_id(&self) -> TaggedChainIdRef<Chain> {
self.map_ref(|val| &val.chain_id)
}
Expand Down
2 changes: 1 addition & 1 deletion tools/test-framework/src/framework/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub struct RunBasicTest<'a, Test> {
pub test: &'a Test,
}

impl<'a, Test, Overrides> PrimitiveTest for RunBasicTest<'a, Test>
impl<Test, Overrides> PrimitiveTest for RunBasicTest<'_, Test>
where
Test: BasicTest,
Test: HasOverrides<Overrides = Overrides>,
Expand Down
12 changes: 6 additions & 6 deletions tools/test-framework/src/framework/binary/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ where
}
}

impl<'a, Test, Overrides> BinaryNodeTest for RunBinaryChainTest<'a, Test>
impl<Test, Overrides> BinaryNodeTest for RunBinaryChainTest<'_, Test>
where
Test: BinaryChainTest,
Test: HasOverrides<Overrides = Overrides>,
Expand Down Expand Up @@ -240,7 +240,7 @@ where
}
}

impl<'a, Test, Overrides> InterchainSecurityChainTest for RunBinaryChainTest<'a, Test>
impl<Test, Overrides> InterchainSecurityChainTest for RunBinaryChainTest<'_, Test>
where
Test: BinaryChainTest,
Test: HasOverrides<Overrides = Overrides>,
Expand Down Expand Up @@ -279,7 +279,7 @@ where
}
}

impl<'a, Test: BinaryChainTest> BinaryChainTest for RunTwoWayBinaryChainTest<'a, Test> {
impl<Test: BinaryChainTest> BinaryChainTest for RunTwoWayBinaryChainTest<'_, Test> {
fn run<ChainA: ChainHandle, ChainB: ChainHandle>(
&self,
config: &TestConfig,
Expand Down Expand Up @@ -308,7 +308,7 @@ impl<'a, Test: BinaryChainTest> BinaryChainTest for RunTwoWayBinaryChainTest<'a,
}
}

impl<'a, Test, Overrides> BinaryChainTest for RunWithSupervisor<'a, Test>
impl<Test, Overrides> BinaryChainTest for RunWithSupervisor<'_, Test>
where
Test: BinaryChainTest,
Test: HasOverrides<Overrides = Overrides>,
Expand All @@ -332,7 +332,7 @@ where
}
}

impl<'a, Test, Overrides> HasOverrides for RunBinaryChainTest<'a, Test>
impl<Test, Overrides> HasOverrides for RunBinaryChainTest<'_, Test>
where
Test: HasOverrides<Overrides = Overrides>,
{
Expand All @@ -343,7 +343,7 @@ where
}
}

impl<'a, Test, Overrides> HasOverrides for RunTwoWayBinaryChainTest<'a, Test>
impl<Test, Overrides> HasOverrides for RunTwoWayBinaryChainTest<'_, Test>
where
Test: HasOverrides<Overrides = Overrides>,
{
Expand Down
10 changes: 5 additions & 5 deletions tools/test-framework/src/framework/binary/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ where
}
}

impl<'a, Test, Overrides> BinaryConnectionTest for RunBinaryChannelTest<'a, Test>
impl<Test, Overrides> BinaryConnectionTest for RunBinaryChannelTest<'_, Test>
where
Test: BinaryChannelTest,
Test: HasOverrides<Overrides = Overrides>,
Expand Down Expand Up @@ -249,7 +249,7 @@ where
}
}

impl<'a, Test: BinaryChannelTest> BinaryChannelTest for RunTwoWayBinaryChannelTest<'a, Test> {
impl<Test: BinaryChannelTest> BinaryChannelTest for RunTwoWayBinaryChannelTest<'_, Test> {
fn run<ChainA: ChainHandle, ChainB: ChainHandle>(
&self,
config: &TestConfig,
Expand Down Expand Up @@ -285,7 +285,7 @@ impl<'a, Test: BinaryChannelTest> BinaryChannelTest for RunTwoWayBinaryChannelTe
}
}

impl<'a, Test, Overrides> BinaryChannelTest for RunWithSupervisor<'a, Test>
impl<Test, Overrides> BinaryChannelTest for RunWithSupervisor<'_, Test>
where
Test: BinaryChannelTest,
Test: HasOverrides<Overrides = Overrides>,
Expand All @@ -310,7 +310,7 @@ where
}
}

impl<'a, Test, Overrides> HasOverrides for RunBinaryChannelTest<'a, Test>
impl<Test, Overrides> HasOverrides for RunBinaryChannelTest<'_, Test>
where
Test: HasOverrides<Overrides = Overrides>,
{
Expand All @@ -321,7 +321,7 @@ where
}
}

impl<'a, Test, Overrides> HasOverrides for RunTwoWayBinaryChannelTest<'a, Test>
impl<Test, Overrides> HasOverrides for RunTwoWayBinaryChannelTest<'_, Test>
where
Test: HasOverrides<Overrides = Overrides>,
{
Expand Down
12 changes: 6 additions & 6 deletions tools/test-framework/src/framework/binary/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ where
}
}

impl<'a, Test, Overrides> BinaryChainTest for RunBinaryConnectionTest<'a, Test>
impl<Test, Overrides> BinaryChainTest for RunBinaryConnectionTest<'_, Test>
where
Test: BinaryConnectionTest,
Test: HasOverrides<Overrides = Overrides>,
Expand Down Expand Up @@ -172,8 +172,8 @@ where
}

Check warning on line 172 in tools/test-framework/src/framework/binary/connection.rs

View workflow job for this annotation

GitHub Actions / fmt

Diff in /home/runner/work/hermes/hermes/tools/test-framework/src/framework/binary/connection.rs
}

impl<'a, Test: BinaryConnectionTest> BinaryConnectionTest
for RunTwoWayBinaryConnectionTest<'a, Test>
impl<Test: BinaryConnectionTest> BinaryConnectionTest
for RunTwoWayBinaryConnectionTest<'_, Test>
{
fn run<ChainA: ChainHandle, ChainB: ChainHandle>(
&self,
Expand Down Expand Up @@ -210,7 +210,7 @@ impl<'a, Test: BinaryConnectionTest> BinaryConnectionTest
}
}

impl<'a, Test, Overrides> BinaryConnectionTest for RunWithSupervisor<'a, Test>
impl<Test, Overrides> BinaryConnectionTest for RunWithSupervisor<'_, Test>
where
Test: BinaryConnectionTest,
Test: HasOverrides<Overrides = Overrides>,
Expand All @@ -235,7 +235,7 @@ where
}
}

impl<'a, Test, Overrides> HasOverrides for RunBinaryConnectionTest<'a, Test>
impl<Test, Overrides> HasOverrides for RunBinaryConnectionTest<'_, Test>
where
Test: HasOverrides<Overrides = Overrides>,
{
Expand All @@ -246,7 +246,7 @@ where
}
}

impl<'a, Test, Overrides> HasOverrides for RunTwoWayBinaryConnectionTest<'a, Test>
impl<Test, Overrides> HasOverrides for RunTwoWayBinaryConnectionTest<'_, Test>
where
Test: HasOverrides<Overrides = Overrides>,
{
Expand Down
4 changes: 2 additions & 2 deletions tools/test-framework/src/framework/binary/ics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ where
}
}

impl<'a, Test, Overrides> BasicTest for RunInterchainSecurityChainTest<'a, Test>
impl<Test, Overrides> BasicTest for RunInterchainSecurityChainTest<'_, Test>
where
Test: InterchainSecurityChainTest,
Test: HasOverrides<Overrides = Overrides>,
Expand Down Expand Up @@ -104,7 +104,7 @@ where
}
}

impl<'a, Test, Overrides> HasOverrides for RunInterchainSecurityChainTest<'a, Test>
impl<Test, Overrides> HasOverrides for RunInterchainSecurityChainTest<'_, Test>
where
Test: HasOverrides<Overrides = Overrides>,
{
Expand Down
Loading

0 comments on commit d2fb99a

Please sign in to comment.