mark deprecated. Selector::value(RefValue) since 0.1.12

This commit is contained in:
freestrings 2019-04-15 11:02:46 +09:00
parent 132f63b7f9
commit e4a50bd689
3 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "jsonpath_lib"
version = "0.1.10"
version = "0.1.11"
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"

View File

@ -77,7 +77,7 @@ let result = selector
.path("$..[?(@.age >= 30)]").unwrap()
// .value_from_str(&serde_json::to_string(&json_obj).unwrap() /*&str*/).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();
assert_eq!(json!([{"name": "친구3", "age": 30}]), result);

View File

@ -91,6 +91,7 @@ impl Selector {
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> {
self.value = Some(ref_value.into());
Ok(self)