From fb07ff574028e392395329a5e68f9f231b929981 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 16 Jun 2021 16:06:24 -0500 Subject: [PATCH] Implement `Clone` for `Linker` (#2993) There's no real reason to not do this, and it can help with some usability use cases! --- crates/wasmtime/src/linker.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/wasmtime/src/linker.rs b/crates/wasmtime/src/linker.rs index 21ec2787de..6fc1c4546d 100644 --- a/crates/wasmtime/src/linker.rs +++ b/crates/wasmtime/src/linker.rs @@ -82,6 +82,20 @@ pub struct Linker { _marker: marker::PhantomData T>, } +impl Clone for Linker { + fn clone(&self) -> Linker { + Linker { + engine: self.engine.clone(), + string2idx: self.string2idx.clone(), + strings: self.strings.clone(), + map: self.map.clone(), + allow_shadowing: self.allow_shadowing, + allow_unknown_exports: self.allow_unknown_exports, + _marker: self._marker, + } + } +} + #[derive(Copy, Clone, Hash, PartialEq, Eq)] struct ImportKey { name: usize,