mirror of
https://github.com/fluencelabs/jsonpath
synced 2025-04-04 16:01:04 +00:00
webassembly - 'filter_ref_value' Value serialize 제거
This commit is contained in:
parent
0729a2a47f
commit
4ad783e40c
@ -9,9 +9,9 @@ extern crate web_sys;
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::result::Result;
|
use std::result::Result;
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
|
use std::ops::Deref;
|
||||||
|
|
||||||
use cfg_if::cfg_if;
|
use cfg_if::cfg_if;
|
||||||
use serde_json::Value;
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
use web_sys::console;
|
use web_sys::console;
|
||||||
|
|
||||||
@ -40,8 +40,8 @@ cfg_if! {
|
|||||||
fn filter_ref_value(json: RefValueWrapper, node: Node) -> JsValue {
|
fn filter_ref_value(json: RefValueWrapper, node: Node) -> JsValue {
|
||||||
let mut jf = JsonValueFilter::new_from_value(json);
|
let mut jf = JsonValueFilter::new_from_value(json);
|
||||||
jf.visit(node);
|
jf.visit(node);
|
||||||
let taken: Value = (&jf.take_value()).into();
|
let taken = &jf.take_value();
|
||||||
match JsValue::from_serde(&taken) {
|
match JsValue::from_serde(taken.deref()) {
|
||||||
Ok(js_value) => js_value,
|
Ok(js_value) => js_value,
|
||||||
Err(e) => JsValue::from_str(&format!("Json deserialize error: {:?}", e))
|
Err(e) => JsValue::from_str(&format!("Json deserialize error: {:?}", e))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user