Implement Clone for Linker (#2993)

There's no real reason to not do this, and it can help with some
usability use cases!
This commit is contained in:
Alex Crichton
2021-06-16 16:06:24 -05:00
committed by GitHub
parent 8ac83a2c63
commit fb07ff5740

View File

@@ -82,6 +82,20 @@ pub struct Linker<T> {
_marker: marker::PhantomData<fn() -> T>,
}
impl<T> Clone for Linker<T> {
fn clone(&self) -> Linker<T> {
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,