mirror of
https://github.com/fluencelabs/jsonpath
synced 2025-04-30 03:42:14 +00:00
mark deprecated. Selector::value(RefValue) since 0.1.12
This commit is contained in:
parent
132f63b7f9
commit
e4a50bd689
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "jsonpath_lib"
|
name = "jsonpath_lib"
|
||||||
version = "0.1.10"
|
version = "0.1.11"
|
||||||
authors = ["Changseok Han <freestrings@gmail.com>"]
|
authors = ["Changseok Han <freestrings@gmail.com>"]
|
||||||
|
|
||||||
description = "It is JsonPath engine written in Rust. it provide a similar API interface in Webassembly and Javascript also. - Webassembly Demo: https://freestrings.github.io/jsonpath"
|
description = "It is JsonPath engine written in Rust. it provide a similar API interface in Webassembly and Javascript also. - Webassembly Demo: https://freestrings.github.io/jsonpath"
|
||||||
|
@ -77,7 +77,7 @@ let result = selector
|
|||||||
.path("$..[?(@.age >= 30)]").unwrap()
|
.path("$..[?(@.age >= 30)]").unwrap()
|
||||||
// .value_from_str(&serde_json::to_string(&json_obj).unwrap() /*&str*/).unwrap()
|
// .value_from_str(&serde_json::to_string(&json_obj).unwrap() /*&str*/).unwrap()
|
||||||
// .value_from(&json_obj /*&impl serde::ser::Serialize*/).unwrap()
|
// .value_from(&json_obj /*&impl serde::ser::Serialize*/).unwrap()
|
||||||
.value((&json_obj /*serde_json::value::Value*/ ).into()).unwrap()
|
.value((&json_obj).into() /*Parameter type will be changed from `RefValue` to `&Value` since `0.1.12`*/ ).unwrap()
|
||||||
.select_to_value().unwrap();
|
.select_to_value().unwrap();
|
||||||
|
|
||||||
assert_eq!(json!([{"name": "친구3", "age": 30}]), result);
|
assert_eq!(json!([{"name": "친구3", "age": 30}]), result);
|
||||||
|
@ -91,6 +91,7 @@ impl Selector {
|
|||||||
Ok(self)
|
Ok(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[deprecated(since = "0.1.12", note = "Parameter type will be changed from `RefValue` to `&Value` since `0.1.12`")]
|
||||||
pub fn value(&mut self, ref_value: RefValue) -> result::Result<&mut Self, String> {
|
pub fn value(&mut self, ref_value: RefValue) -> result::Result<&mut Self, String> {
|
||||||
self.value = Some(ref_value.into());
|
self.value = Some(ref_value.into());
|
||||||
Ok(self)
|
Ok(self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user