diff --git a/lib/api/src/sys/externals/memory_view.rs b/lib/api/src/sys/externals/memory_view.rs index 1ccfc6cba1d..3250f4d6c05 100644 --- a/lib/api/src/sys/externals/memory_view.rs +++ b/lib/api/src/sys/externals/memory_view.rs @@ -96,7 +96,7 @@ impl<'a> MemoryView<'a> { } pub(crate) fn buffer(&'a self) -> MemoryBuffer<'a> { - self.buffer.clone() + self.buffer } /// Safely reads bytes from the memory at the given offset. diff --git a/lib/api/src/sys/mem_access.rs b/lib/api/src/sys/mem_access.rs index 623796f11b0..28204577a22 100644 --- a/lib/api/src/sys/mem_access.rs +++ b/lib/api/src/sys/mem_access.rs @@ -64,7 +64,7 @@ impl<'a, T: ValueType> WasmRef<'a, T> { #[inline] pub fn new(view: &'a MemoryView, offset: u64) -> Self { Self { - buffer: view.buffer.clone(), + buffer: view.buffer, offset, marker: PhantomData, } diff --git a/lib/emscripten/src/utils.rs b/lib/emscripten/src/utils.rs index af55a1b046d..903e1e9a262 100644 --- a/lib/emscripten/src/utils.rs +++ b/lib/emscripten/src/utils.rs @@ -234,7 +234,7 @@ pub unsafe fn copy_stat_into_wasm(ctx: FunctionEnvMut, buf: u32, stat: &s #[allow(dead_code)] // it's used in `env/windows/mod.rs`. pub fn read_string_from_wasm(memory: &MemoryView, offset: u32) -> String { WasmPtr::::new(offset) - .read_utf8_string_with_nul(&memory) + .read_utf8_string_with_nul(memory) .unwrap() }