From ce3ebaefa08f49b86cb4c531b875001efe672fa2 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Fri, 6 May 2022 17:15:49 +0200 Subject: [PATCH] chore(clippy): make clippy happy (#1230) --- ethers-contract/ethers-contract-abigen/src/contract.rs | 2 +- ethers-contract/src/multicall/multicall_contract.rs | 2 +- ethers-core/src/utils/anvil.rs | 2 +- ethers-core/src/utils/ganache.rs | 2 +- ethers-core/src/utils/geth.rs | 2 +- ethers-etherscan/src/contract.rs | 8 ++++---- ethers-middleware/src/transformer/ds_proxy/factory.rs | 2 +- ethers-providers/src/pending_escalator.rs | 2 +- ethers-providers/src/pending_transaction.rs | 2 +- ethers-solc/src/sourcemap.rs | 6 +++--- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ethers-contract/ethers-contract-abigen/src/contract.rs b/ethers-contract/ethers-contract-abigen/src/contract.rs index 2dd4a4fa..288af663 100644 --- a/ethers-contract/ethers-contract-abigen/src/contract.rs +++ b/ethers-contract/ethers-contract-abigen/src/contract.rs @@ -133,7 +133,7 @@ impl Context { let contract = quote! { #struct_decl - impl<'a, M: #ethers_providers::Middleware> #name { + impl #name { /// Creates a new contract instance with the specified `ethers` /// client at the given `Address`. The contract derefs to a `ethers::Contract` /// object diff --git a/ethers-contract/src/multicall/multicall_contract.rs b/ethers-contract/src/multicall/multicall_contract.rs index c83753d0..33ccc625 100644 --- a/ethers-contract/src/multicall/multicall_contract.rs +++ b/ethers-contract/src/multicall/multicall_contract.rs @@ -33,7 +33,7 @@ mod multicallcontract_mod { f.debug_tuple(stringify!(MulticallContract)).field(&self.address()).finish() } } - impl<'a, M: Middleware> MulticallContract { + impl MulticallContract { #[doc = r" Creates a new contract instance with the specified `ethers`"] #[doc = r" client at the given `Address`. The contract derefs to a `ethers::Contract`"] #[doc = r" object"] diff --git a/ethers-core/src/utils/anvil.rs b/ethers-core/src/utils/anvil.rs index fe75514a..37a15ebd 100644 --- a/ethers-core/src/utils/anvil.rs +++ b/ethers-core/src/utils/anvil.rs @@ -51,7 +51,7 @@ impl AnvilInstance { impl Drop for AnvilInstance { fn drop(&mut self) { - let _ = self.pid.kill().expect("could not kill anvil"); + self.pid.kill().expect("could not kill anvil"); } } diff --git a/ethers-core/src/utils/ganache.rs b/ethers-core/src/utils/ganache.rs index 45ef5b8d..d591ee49 100644 --- a/ethers-core/src/utils/ganache.rs +++ b/ethers-core/src/utils/ganache.rs @@ -51,7 +51,7 @@ impl GanacheInstance { impl Drop for GanacheInstance { fn drop(&mut self) { - let _ = self.pid.kill().expect("could not kill ganache"); + self.pid.kill().expect("could not kill ganache"); } } diff --git a/ethers-core/src/utils/geth.rs b/ethers-core/src/utils/geth.rs index 9016bc8f..2a65ab94 100644 --- a/ethers-core/src/utils/geth.rs +++ b/ethers-core/src/utils/geth.rs @@ -47,7 +47,7 @@ impl GethInstance { impl Drop for GethInstance { fn drop(&mut self) { - let _ = self.pid.kill().expect("could not kill geth"); + self.pid.kill().expect("could not kill geth"); } } diff --git a/ethers-etherscan/src/contract.rs b/ethers-etherscan/src/contract.rs index b390a5ab..b7bb7da7 100644 --- a/ethers-etherscan/src/contract.rs +++ b/ethers-etherscan/src/contract.rs @@ -305,14 +305,14 @@ impl Client { } if resp.result.starts_with("Contract source code not verified") { if let Some(ref cache) = self.cache { - let _ = cache.set_abi(address, None); + cache.set_abi(address, None); } return Err(EtherscanError::ContractCodeNotVerified(address)) } let abi = serde_json::from_str(&resp.result)?; if let Some(ref cache) = self.cache { - let _ = cache.set_abi(address, Some(&abi)); + cache.set_abi(address, Some(&abi)); } Ok(abi) @@ -350,14 +350,14 @@ impl Client { let response: Response> = self.get_json(&query).await?; if response.result.iter().any(|item| item.abi == "Contract source code not verified") { if let Some(ref cache) = self.cache { - let _ = cache.set_source(address, None); + cache.set_source(address, None); } return Err(EtherscanError::ContractCodeNotVerified(address)) } let res = ContractMetadata { items: response.result }; if let Some(ref cache) = self.cache { - let _ = cache.set_source(address, Some(&res)); + cache.set_source(address, Some(&res)); } Ok(res) diff --git a/ethers-middleware/src/transformer/ds_proxy/factory.rs b/ethers-middleware/src/transformer/ds_proxy/factory.rs index 4c5b05e2..8de0c88f 100644 --- a/ethers-middleware/src/transformer/ds_proxy/factory.rs +++ b/ethers-middleware/src/transformer/ds_proxy/factory.rs @@ -63,7 +63,7 @@ mod dsproxyfactory_mod { f.debug_tuple(stringify!(DsProxyFactory)).field(&self.address()).finish() } } - impl<'a, M: Middleware> DsProxyFactory { + impl DsProxyFactory { #[doc = r" Creates a new contract instance with the specified `ethers`"] #[doc = r" client at the given `Address`. The contract derefs to a `ethers::Contract`"] #[doc = r" object"] diff --git a/ethers-providers/src/pending_escalator.rs b/ethers-providers/src/pending_escalator.rs index b813f986..3dca65fb 100644 --- a/ethers-providers/src/pending_escalator.rs +++ b/ethers-providers/src/pending_escalator.rs @@ -190,7 +190,7 @@ where poll_broadcast_fut!(cx, this, fut); } Sleeping(delay) => { - let _ready = futures_util::ready!(delay.as_mut().poll(cx)); + futures_util::ready!(delay.as_mut().poll(cx)); // if broadcast timer has elapsed and if we have a TX to // broadcast, broadcast it if this.last.elapsed() > *this.broadcast_interval { diff --git a/ethers-providers/src/pending_transaction.rs b/ethers-providers/src/pending_transaction.rs index 17451b7e..68757aa8 100644 --- a/ethers-providers/src/pending_transaction.rs +++ b/ethers-providers/src/pending_transaction.rs @@ -172,7 +172,7 @@ impl<'a, P: JsonRpcClient> Future for PendingTransaction<'a, P> { match this.state { PendingTxState::InitialDelay(fut) => { - let _ready = futures_util::ready!(fut.as_mut().poll(ctx)); + futures_util::ready!(fut.as_mut().poll(ctx)); tracing::debug!("Starting to poll pending tx {:?}", *this.tx_hash); let fut = Box::pin(this.provider.get_transaction(*this.tx_hash)); rewake_with_new_state!(ctx, this, PendingTxState::GettingTx(fut)); diff --git a/ethers-solc/src/sourcemap.rs b/ethers-solc/src/sourcemap.rs index 6b47c65c..e1cf8a62 100644 --- a/ethers-solc/src/sourcemap.rs +++ b/ethers-solc/src/sourcemap.rs @@ -134,7 +134,7 @@ impl AsRef for Jump { } } -impl<'a> fmt::Display for Jump { +impl fmt::Display for Jump { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.as_ref()) } @@ -176,7 +176,7 @@ pub struct SourceElement { pub modifier_depth: usize, } -impl<'a> fmt::Display for SourceElement { +impl fmt::Display for SourceElement { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!( f, @@ -199,7 +199,7 @@ struct SourceElementBuilder { pub modifier_depth: Option, } -impl<'a> fmt::Display for SourceElementBuilder { +impl fmt::Display for SourceElementBuilder { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { if self.offset.is_none() && self.length.is_none() &&