Skip to content

Commit

Permalink
Temporarily fix module relying on closed memory leak
Browse files Browse the repository at this point in the history
It only half fixes this, it will be solved properly in lens-vm/lens#62
  • Loading branch information
AndrewSisley committed Nov 10, 2023
1 parent 597d8f3 commit 328caa7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/lenses/rust_wasm32_copy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ fn try_transform(ptr: *mut u8) -> Result<Option<Vec<u8>>, Box<dyn Error>> {
.ok_or(ModuleError::PropertyNotFoundError{requested: params.src.clone()})?
.clone();

input.insert(params.dst, value);
let mut result = input.clone();
result.insert(params.dst, value);

let result_json = serde_json::to_vec(&input)?;
let result_json = serde_json::to_vec(&result)?;
Ok(Some(result_json))
}

0 comments on commit 328caa7

Please sign in to comment.