Deserialize to serde_json::Value

This commit is contained in:
Stephen Chung 2022-11-22 16:25:25 +08:00
parent 7c4e751d33
commit 05c7d00a8e

View File

@ -825,7 +825,14 @@ fn test_serde_blob() -> Result<(), Box<EvalAltResult>> {
fn test_serde_json_borrowed_string() { fn test_serde_json_borrowed_string() {
let value = json!({ "a": "b" }); let value = json!({ "a": "b" });
println!("value: {value:?}"); println!("value: {value:?}");
let _: Dynamic = serde_json::from_value(value).unwrap();
let result: Dynamic = serde_json::from_value(value.clone()).unwrap();
println!("result: {result:?}");
let value2 = serde_json::to_value(&result).unwrap();
println!("value2: {value2:?}");
assert_eq!(value, value2);
} }
#[test] #[test]