From 4ed46089d8aa567180ad1d4ae933f5250ba3ec8b Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sat, 24 Sep 2022 21:40:08 +0200 Subject: [PATCH] contract: return `Arc` instead of `&M` (#1731) * return Arc instead of &M * docs --- ethers-contract/src/contract.rs | 6 +++--- ethers-contract/src/factory.rs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ethers-contract/src/contract.rs b/ethers-contract/src/contract.rs index 17443e5a..11ec62a3 100644 --- a/ethers-contract/src/contract.rs +++ b/ethers-contract/src/contract.rs @@ -185,9 +185,9 @@ impl Contract { &self.base_contract.abi } - /// Returns a reference to the contract's client - pub fn client(&self) -> &M { - &self.client + /// Returns a pointer to the contract's client + pub fn client(&self) -> Arc { + self.client.clone() } } diff --git a/ethers-contract/src/factory.rs b/ethers-contract/src/factory.rs index 7f51e8d3..bffb9045 100644 --- a/ethers-contract/src/factory.rs +++ b/ethers-contract/src/factory.rs @@ -147,8 +147,8 @@ impl>> ContractDeployer { self.deployer.abi() } - /// Returns a reference to the deployer's client - pub fn client(&self) -> &M { + /// Returns a pointer to the deployer's client + pub fn client(&self) -> Arc { self.deployer.client() } } @@ -261,9 +261,9 @@ impl Deployer { &self.abi } - /// Returns a reference to the deployer's client - pub fn client(&self) -> &M { - &self.client + /// Returns a pointer to the deployer's client + pub fn client(&self) -> Arc { + self.client.clone() } }