From beabd2d644ea33f944028fa6fff5dc0e6b3a050d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=A4rtens?= Date: Fri, 17 May 2024 19:00:22 +0200 Subject: [PATCH] some clippy fixes --- src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 612f13a..1e0fd25 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -328,9 +328,10 @@ impl<'a, Data: Clone + Debug + Default> JsonPathValue<'a, Data> { } impl<'a, Data> JsonPathValue<'a, Data> { - fn only_no_value(input: &Vec>) -> bool { + fn only_no_value(input: &[JsonPathValue<'a, Data>]) -> bool { !input.is_empty() && input.iter().filter(|v| v.has_value()).count() == 0 } + fn map_vec(data: Vec<(&'a Data, JsPathStr)>) -> Vec> { data.into_iter() .map(|(data, pref)| Slice(data, pref)) @@ -411,7 +412,7 @@ pub fn find_slice<'a>(path: &'a JsonPathInst, json: &'a Value) -> Vec Value { - let slice = find_slice(&path, &json); + let slice = find_slice(path, json); if !slice.is_empty() { if JsonPathValue::only_no_value(&slice) { Value::Null