diff --git a/Cargo.toml b/Cargo.toml index c195c73974..f6c731898b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -109,6 +109,7 @@ tracing-log = "0.1" tracing-gelf = "0.7" simple-logging = "2.0.2" tokio = {version = "1", features=["macros"]} +anyhow="1" [dev-dependencies.cargo-husky] version = "1.5.0" diff --git a/src/quickjs_utils/json.rs b/src/quickjs_utils/json.rs index 680e18f000..0e58f60478 100644 --- a/src/quickjs_utils/json.rs +++ b/src/quickjs_utils/json.rs @@ -157,13 +157,13 @@ pub mod tests { .unwrap(); let str_res = json::stringify_q(q_ctx, &obj, None).ok().unwrap(); assert_eq!(str_res.get_ref_count(), 1); - let json = str_res.to_str().ok().unwrap(); + let json = str_res.to_string().ok().unwrap(); assert_eq!(json, "{\"a\":532,\"b\":true,\"c\":\"abcdË\"}"); - let obj2 = json::parse_q(q_ctx, json).ok().unwrap(); + let obj2 = parse_q(q_ctx, json.as_str()).ok().unwrap(); let prop_c = objects::get_property_q(q_ctx, &obj2, "c").ok().unwrap(); - assert_eq!("abcdË", prop_c.to_str().ok().unwrap()); + assert_eq!("abcdË", prop_c.to_string().ok().unwrap()); }); }