Skip to content

Commit

Permalink
chore(clippy): make clippy happy (gakonst#1230)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed May 6, 2022
1 parent 2768a6b commit ce3ebae
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion ethers-contract/ethers-contract-abigen/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl Context {
let contract = quote! {
#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`
/// client at the given `Address`. The contract derefs to a `ethers::Contract`
/// object
Expand Down
2 changes: 1 addition & 1 deletion ethers-contract/src/multicall/multicall_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ mod multicallcontract_mod {
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" client at the given `Address`. The contract derefs to a `ethers::Contract`"]
#[doc = r" object"]
Expand Down
2 changes: 1 addition & 1 deletion ethers-core/src/utils/anvil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down
2 changes: 1 addition & 1 deletion ethers-core/src/utils/ganache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down
2 changes: 1 addition & 1 deletion ethers-core/src/utils/geth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down
8 changes: 4 additions & 4 deletions ethers-etherscan/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -350,14 +350,14 @@ impl Client {
let response: Response<Vec<Metadata>> = 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)
Expand Down
2 changes: 1 addition & 1 deletion ethers-middleware/src/transformer/ds_proxy/factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ mod dsproxyfactory_mod {
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" client at the given `Address`. The contract derefs to a `ethers::Contract`"]
#[doc = r" object"]
Expand Down
2 changes: 1 addition & 1 deletion ethers-providers/src/pending_escalator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion ethers-providers/src/pending_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
6 changes: 3 additions & 3 deletions ethers-solc/src/sourcemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
f.write_str(self.as_ref())
}
Expand Down Expand Up @@ -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,
Expand All @@ -199,7 +199,7 @@ struct SourceElementBuilder {
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 {
if self.offset.is_none() &&
self.length.is_none() &&
Expand Down

0 comments on commit ce3ebae

Please sign in to comment.