From d9b9e9d8bd167bbdda12dd44a860bf90bcaf7f73 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Wed, 31 Jul 2019 16:22:35 +0300 Subject: [PATCH] move lifetime to result lifetime should be on the Vec<&'a Value> and not on the input --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index d7caebb..1120788 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -214,7 +214,7 @@ pub fn compile(path: &str) -> impl FnMut(&Value) -> Result, JsonPath /// ]); /// ``` #[allow(clippy::needless_lifetimes)] -pub fn selector<'a>(json: &'a Value) -> impl FnMut(&'a str) -> Result, JsonPathError> { +pub fn selector<'a>(json: &'a Value) -> impl FnMut(&str) -> Result, JsonPathError> { let mut selector = Selector::default(); let _ = selector.value(json); move |path: &str| selector.str_path(path)?.reset_value().select()