fix clippy error

This commit is contained in:
freestrings 2020-02-10 23:53:56 +09:00
parent c2a6f3b319
commit 3b4d2b4ffc

View File

@ -1096,7 +1096,7 @@ fn replace_value<F: FnMut(Value) -> Option<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() {
let target_once = target;
let is_last = i == last_index;