From 969d4e01c0c96d5f2af161b2db2595dd0e408182 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Thu, 21 Apr 2022 17:05:23 +0200 Subject: [PATCH] feat: accept different middlewares for contract connect (#1159) --- ethers-contract/src/contract.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ethers-contract/src/contract.rs b/ethers-contract/src/contract.rs index de909145..1202c0e5 100644 --- a/ethers-contract/src/contract.rs +++ b/ethers-contract/src/contract.rs @@ -261,13 +261,11 @@ impl Contract { /// /// Clones `self` internally #[must_use] - pub fn connect(&self, client: Arc) -> Self + pub fn connect(&self, client: Arc) -> Contract where - M: Clone, + N: Clone, { - let mut this = self.clone(); - this.client = client; - this + Contract { base_contract: self.base_contract.clone(), client, address: self.address } } /// Returns the contract's address