mirror of
https://github.com/fluencelabs/jsonpath
synced 2025-06-15 17:11:27 +00:00
fix clippy error
This commit is contained in:
@ -1096,7 +1096,7 @@ fn replace_value<F: FnMut(Value) -> Option<Value>>(
|
|||||||
) {
|
) {
|
||||||
let mut target = value;
|
let mut target = value;
|
||||||
|
|
||||||
let last_index = tokens.len().checked_sub(1).unwrap_or(0);
|
let last_index = tokens.len().saturating_sub(1);
|
||||||
for (i, token) in tokens.drain(..).enumerate() {
|
for (i, token) in tokens.drain(..).enumerate() {
|
||||||
let target_once = target;
|
let target_once = target;
|
||||||
let is_last = i == last_index;
|
let is_last = i == last_index;
|
||||||
|
Reference in New Issue
Block a user