mirror of
https://github.com/fluencelabs/jsonpath
synced 2025-04-25 17:32:15 +00:00
move lifetime to result
lifetime should be on the Vec<&'a Value> and not on the input
This commit is contained in:
parent
c0a5296451
commit
d9b9e9d8bd
@ -214,7 +214,7 @@ pub fn compile(path: &str) -> impl FnMut(&Value) -> Result<Vec<&Value>, JsonPath
|
|||||||
/// ]);
|
/// ]);
|
||||||
/// ```
|
/// ```
|
||||||
#[allow(clippy::needless_lifetimes)]
|
#[allow(clippy::needless_lifetimes)]
|
||||||
pub fn selector<'a>(json: &'a Value) -> impl FnMut(&'a str) -> Result<Vec<&Value>, JsonPathError> {
|
pub fn selector<'a>(json: &'a Value) -> impl FnMut(&str) -> Result<Vec<&'a Value>, JsonPathError> {
|
||||||
let mut selector = Selector::default();
|
let mut selector = Selector::default();
|
||||||
let _ = selector.value(json);
|
let _ = selector.value(json);
|
||||||
move |path: &str| selector.str_path(path)?.reset_value().select()
|
move |path: &str| selector.str_path(path)?.reset_value().select()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user