From e6431a019f04ff1b95d79b584243c2a04a1327f3 Mon Sep 17 00:00:00 2001 From: Benno Zeeman Date: Mon, 16 Dec 2024 16:31:03 +0100 Subject: [PATCH] fix(autonomi): fix archive borrow in WASM --- autonomi/src/client/wasm.rs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/autonomi/src/client/wasm.rs b/autonomi/src/client/wasm.rs index 5203c11c05..ce49ba83d2 100644 --- a/autonomi/src/client/wasm.rs +++ b/autonomi/src/client/wasm.rs @@ -263,10 +263,7 @@ mod archive { archive: &JsArchive, wallet: &JsWallet, ) -> Result { - let addr = self - .0 - .archive_put_public(archive.0.clone(), &wallet.0) - .await?; + let addr = self.0.archive_put_public(&archive.0, &wallet.0).await?; Ok(addr_to_str(addr)) } @@ -348,10 +345,7 @@ mod archive_private { archive: &JsPrivateArchive, wallet: &JsWallet, ) -> Result { - let private_archive_access = self - .0 - .archive_put(archive.0.clone(), (&wallet.0).into()) - .await?; + let private_archive_access = self.0.archive_put(&archive.0, (&wallet.0).into()).await?; let js_value = serde_wasm_bindgen::to_value(&private_archive_access)?; @@ -370,10 +364,7 @@ mod archive_private { ) -> Result { let receipt: Receipt = serde_wasm_bindgen::from_value(receipt)?; - let private_archive_access = self - .0 - .archive_put(archive.0.clone(), receipt.into()) - .await?; + let private_archive_access = self.0.archive_put(&archive.0, receipt.into()).await?; let js_value = serde_wasm_bindgen::to_value(&private_archive_access)?;