From 94c84a1c8e1193bca05ad199b938e9e3e44d6176 Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Wed, 25 Oct 2023 14:53:41 +0800 Subject: [PATCH] fix: lint issue on first() --- src/json/path.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/json/path.rs b/src/json/path.rs index 288c1561a..5b810839a 100644 --- a/src/json/path.rs +++ b/src/json/path.rs @@ -72,7 +72,7 @@ impl Path { } fn get_local_path_and_level(paths: &[PathSeg]) -> Option<(usize, String)> { - paths.get(0).and_then(|seg| { + paths.first().and_then(|seg| { if seg == &PathSeg::Ruled(Rule::path_local) { let mut level = 0; while paths.get(level + 1)? == &PathSeg::Ruled(Rule::path_up) {