mirror of
https://github.com/fluencelabs/jsonpath
synced 2025-06-11 15:11:25 +00:00
fix #29 check for overflow
This commit is contained in:
committed by
Changseok Han
parent
9fa0f74ce9
commit
636618e4ac
@ -1058,7 +1058,7 @@ fn replace_value<F: FnMut(Value) -> Option<Value>>(
|
||||
) {
|
||||
let mut target = value;
|
||||
|
||||
let last_index = tokens.len() - 1;
|
||||
let last_index = tokens.len().checked_sub(1).unwrap_or(0);
|
||||
for (i, token) in tokens.drain(..).enumerate() {
|
||||
let target_once = target;
|
||||
let is_last = i == last_index;
|
||||
|
Reference in New Issue
Block a user