Skip to content

Commit beabd2d

Browse files
committed
some clippy fixes
1 parent 95b99a8 commit beabd2d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,10 @@ impl<'a, Data: Clone + Debug + Default> JsonPathValue<'a, Data> {
328328
}
329329

330330
impl<'a, Data> JsonPathValue<'a, Data> {
331-
fn only_no_value(input: &Vec<JsonPathValue<'a, Data>>) -> bool {
331+
fn only_no_value(input: &[JsonPathValue<'a, Data>]) -> bool {
332332
!input.is_empty() && input.iter().filter(|v| v.has_value()).count() == 0
333333
}
334+
334335
fn map_vec(data: Vec<(&'a Data, JsPathStr)>) -> Vec<JsonPathValue<'a, Data>> {
335336
data.into_iter()
336337
.map(|(data, pref)| Slice(data, pref))
@@ -411,7 +412,7 @@ pub fn find_slice<'a>(path: &'a JsonPathInst, json: &'a Value) -> Vec<JsonPathVa
411412
/// finds a slice of data and wrap it with Value::Array by cloning the data.
412413
/// Returns either an array of elements or Json::Null if the match is incorrect.
413414
pub fn find(path: &JsonPathInst, json: &Value) -> Value {
414-
let slice = find_slice(&path, &json);
415+
let slice = find_slice(path, json);
415416
if !slice.is_empty() {
416417
if JsonPathValue::only_no_value(&slice) {
417418
Value::Null

0 commit comments

Comments
 (0)