compiled_path 인자 타입 변경, compute_path 로직 개선

This commit is contained in:
freestrings
2019-06-11 16:12:40 +09:00
parent fbb2b49ba0
commit 2e9e0ac6fc
7 changed files with 78 additions and 74 deletions

View File

@ -14,8 +14,8 @@ exclude = ["artifacts.json", "index.node"]
neon-build = "0.2.0"
[dependencies]
#jsonpath_lib = "0.2.0"
jsonpath_lib = {path="../../"}
jsonpath_lib = "0.2.0"
#jsonpath_lib = { path = "../../" }
neon = "0.2.0"
neon-serde = "0.1.1"
serde_json = { version = "1.0", features = ["preserve_order"] }

View File

@ -110,7 +110,7 @@ impl SelectorCls {
fn select(&self) -> String {
let node = match &self.node {
Some(node) => node.clone(),
Some(node) => node,
None => panic!("{:?}", JsonPathError::EmptyPath)
};
@ -120,7 +120,7 @@ impl SelectorCls {
};
let mut selector = Selector::new();
selector.compiled_path(node.clone());
selector.compiled_path(node);
selector.value(&value);
match selector.select_as_str() {
Ok(ret) => ret,