Skip to content

Commit f397a14

Browse files
committed
Avoid the need for BackendApi to be Copy
1 parent 6374c43 commit f397a14

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/vm/src/backend.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ pub trait Storage {
165165
/// Currently it just supports address conversion, we could add eg. crypto functions here.
166166
/// These should all be pure (stateless) functions. If you need state, you probably want
167167
/// to use the Querier.
168-
pub trait BackendApi: Copy + Clone + Send {
168+
pub trait BackendApi: Clone + Send {
169169
fn addr_validate(&self, input: &str) -> BackendResult<()>;
170170
fn addr_canonicalize(&self, human: &str) -> BackendResult<Vec<u8>>;
171171
fn addr_humanize(&self, canonical: &[u8]) -> BackendResult<String>;

packages/vm/src/environment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl<A: BackendApi, S: Storage, Q: Querier> Clone for Environment<A, S, Q> {
125125
fn clone(&self) -> Self {
126126
Environment {
127127
memory: None,
128-
api: self.api,
128+
api: self.api.clone(),
129129
gas_config: self.gas_config.clone(),
130130
data: self.data.clone(),
131131
}

packages/vm/src/instance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ where
294294

295295
let env = fe.as_ref(&store);
296296
if let (Some(storage), Some(querier)) = env.move_out() {
297-
let api = env.api;
297+
let api = env.api.clone();
298298
Some(Backend {
299299
api,
300300
storage,

0 commit comments

Comments
 (0)