chore(clippy): make clippy happy (#1230)

This commit is contained in:
Matthias Seitz 2022-05-06 17:15:49 +02:00 committed by GitHub
parent 2768a6b4d7
commit ce3ebaefa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 15 additions and 15 deletions

View File

@ -133,7 +133,7 @@ impl Context {
let contract = quote! { let contract = quote! {
#struct_decl #struct_decl
impl<'a, M: #ethers_providers::Middleware> #name<M> { impl<M: #ethers_providers::Middleware> #name<M> {
/// Creates a new contract instance with the specified `ethers` /// Creates a new contract instance with the specified `ethers`
/// client at the given `Address`. The contract derefs to a `ethers::Contract` /// client at the given `Address`. The contract derefs to a `ethers::Contract`
/// object /// object

View File

@ -33,7 +33,7 @@ mod multicallcontract_mod {
f.debug_tuple(stringify!(MulticallContract)).field(&self.address()).finish() f.debug_tuple(stringify!(MulticallContract)).field(&self.address()).finish()
} }
} }
impl<'a, M: Middleware> MulticallContract<M> { impl<M: Middleware> MulticallContract<M> {
#[doc = r" Creates a new contract instance with the specified `ethers`"] #[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" client at the given `Address`. The contract derefs to a `ethers::Contract`"]
#[doc = r" object"] #[doc = r" object"]

View File

@ -51,7 +51,7 @@ impl AnvilInstance {
impl Drop for AnvilInstance { impl Drop for AnvilInstance {
fn drop(&mut self) { fn drop(&mut self) {
let _ = self.pid.kill().expect("could not kill anvil"); self.pid.kill().expect("could not kill anvil");
} }
} }

View File

@ -51,7 +51,7 @@ impl GanacheInstance {
impl Drop for GanacheInstance { impl Drop for GanacheInstance {
fn drop(&mut self) { fn drop(&mut self) {
let _ = self.pid.kill().expect("could not kill ganache"); self.pid.kill().expect("could not kill ganache");
} }
} }

View File

@ -47,7 +47,7 @@ impl GethInstance {
impl Drop for GethInstance { impl Drop for GethInstance {
fn drop(&mut self) { fn drop(&mut self) {
let _ = self.pid.kill().expect("could not kill geth"); self.pid.kill().expect("could not kill geth");
} }
} }

View File

@ -305,14 +305,14 @@ impl Client {
} }
if resp.result.starts_with("Contract source code not verified") { if resp.result.starts_with("Contract source code not verified") {
if let Some(ref cache) = self.cache { if let Some(ref cache) = self.cache {
let _ = cache.set_abi(address, None); cache.set_abi(address, None);
} }
return Err(EtherscanError::ContractCodeNotVerified(address)) return Err(EtherscanError::ContractCodeNotVerified(address))
} }
let abi = serde_json::from_str(&resp.result)?; let abi = serde_json::from_str(&resp.result)?;
if let Some(ref cache) = self.cache { if let Some(ref cache) = self.cache {
let _ = cache.set_abi(address, Some(&abi)); cache.set_abi(address, Some(&abi));
} }
Ok(abi) Ok(abi)
@ -350,14 +350,14 @@ impl Client {
let response: Response<Vec<Metadata>> = self.get_json(&query).await?; let response: Response<Vec<Metadata>> = self.get_json(&query).await?;
if response.result.iter().any(|item| item.abi == "Contract source code not verified") { if response.result.iter().any(|item| item.abi == "Contract source code not verified") {
if let Some(ref cache) = self.cache { if let Some(ref cache) = self.cache {
let _ = cache.set_source(address, None); cache.set_source(address, None);
} }
return Err(EtherscanError::ContractCodeNotVerified(address)) return Err(EtherscanError::ContractCodeNotVerified(address))
} }
let res = ContractMetadata { items: response.result }; let res = ContractMetadata { items: response.result };
if let Some(ref cache) = self.cache { if let Some(ref cache) = self.cache {
let _ = cache.set_source(address, Some(&res)); cache.set_source(address, Some(&res));
} }
Ok(res) Ok(res)

View File

@ -63,7 +63,7 @@ mod dsproxyfactory_mod {
f.debug_tuple(stringify!(DsProxyFactory)).field(&self.address()).finish() f.debug_tuple(stringify!(DsProxyFactory)).field(&self.address()).finish()
} }
} }
impl<'a, M: Middleware> DsProxyFactory<M> { impl<M: Middleware> DsProxyFactory<M> {
#[doc = r" Creates a new contract instance with the specified `ethers`"] #[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" client at the given `Address`. The contract derefs to a `ethers::Contract`"]
#[doc = r" object"] #[doc = r" object"]

View File

@ -190,7 +190,7 @@ where
poll_broadcast_fut!(cx, this, fut); poll_broadcast_fut!(cx, this, fut);
} }
Sleeping(delay) => { 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 // if broadcast timer has elapsed and if we have a TX to
// broadcast, broadcast it // broadcast, broadcast it
if this.last.elapsed() > *this.broadcast_interval { if this.last.elapsed() > *this.broadcast_interval {

View File

@ -172,7 +172,7 @@ impl<'a, P: JsonRpcClient> Future for PendingTransaction<'a, P> {
match this.state { match this.state {
PendingTxState::InitialDelay(fut) => { 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); tracing::debug!("Starting to poll pending tx {:?}", *this.tx_hash);
let fut = Box::pin(this.provider.get_transaction(*this.tx_hash)); let fut = Box::pin(this.provider.get_transaction(*this.tx_hash));
rewake_with_new_state!(ctx, this, PendingTxState::GettingTx(fut)); rewake_with_new_state!(ctx, this, PendingTxState::GettingTx(fut));

View File

@ -134,7 +134,7 @@ impl AsRef<str> for Jump {
} }
} }
impl<'a> fmt::Display for Jump { impl fmt::Display for Jump {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_ref()) f.write_str(self.as_ref())
} }
@ -176,7 +176,7 @@ pub struct SourceElement {
pub modifier_depth: usize, pub modifier_depth: usize,
} }
impl<'a> fmt::Display for SourceElement { impl fmt::Display for SourceElement {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!( write!(
f, f,
@ -199,7 +199,7 @@ struct SourceElementBuilder {
pub modifier_depth: Option<usize>, pub modifier_depth: Option<usize>,
} }
impl<'a> fmt::Display for SourceElementBuilder { impl fmt::Display for SourceElementBuilder {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
if self.offset.is_none() && if self.offset.is_none() &&
self.length.is_none() && self.length.is_none() &&