Skip to content

Commit ed60b19

Browse files
committed
Use vm.{,de}serialize in rustpython_wasm
1 parent d024e7e commit ed60b19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wasm/lib/src/convert.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ pub fn py_to_js(vm: &mut VirtualMachine, py_obj: PyObjectRef) -> JsValue {
130130
}
131131
arr.into()
132132
} else {
133-
match rustpython_vm::stdlib::json::ser_pyobject(vm, &py_obj) {
133+
match vm.serialize(&py_obj) {
134134
Ok(json) => js_sys::JSON::parse(&json).unwrap_or(JsValue::UNDEFINED),
135135
Err(_) => JsValue::UNDEFINED,
136136
}
@@ -227,6 +227,6 @@ pub fn js_to_py(vm: &mut VirtualMachine, js_val: JsValue) -> PyObjectRef {
227227
Ok(json) => String::from(json),
228228
Err(_) => return vm.get_none(),
229229
};
230-
rustpython_vm::stdlib::json::de_pyobject(vm, &json).unwrap_or_else(|_| vm.get_none())
230+
vm.deserialize(&json).unwrap_or_else(|_| vm.get_none())
231231
}
232232
}

0 commit comments

Comments
 (0)