From e4a50bd689fe7466b81294bcfc6b5e6a295b8998 Mon Sep 17 00:00:00 2001 From: freestrings Date: Mon, 15 Apr 2019 11:02:46 +0900 Subject: [PATCH] mark deprecated. Selector::value(RefValue) since 0.1.12 --- Cargo.toml | 2 +- README.md | 2 +- src/select/mod.rs | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 570e875..686b66e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jsonpath_lib" -version = "0.1.10" +version = "0.1.11" authors = ["Changseok Han "] 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" diff --git a/README.md b/README.md index a9ea931..e914144 100644 --- a/README.md +++ b/README.md @@ -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); diff --git a/src/select/mod.rs b/src/select/mod.rs index 1872be4..b6b316a 100644 --- a/src/select/mod.rs +++ b/src/select/mod.rs @@ -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)