Skip to content

Commit

Permalink
Merge pull request #406 from matthiasbeyer/fix-clippy-unnecessary-cast
Browse files Browse the repository at this point in the history
Fix clippy: Remove unnecessary cast
  • Loading branch information
matthiasbeyer authored Dec 16, 2022
2 parents 6830574 + a5aa8b7 commit 040958c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/path/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ impl Expression {
let index = sindex_to_uindex(index, array.len());

if index >= array.len() {
array
.resize((index + 1) as usize, Value::new(None, ValueKind::Nil));
array.resize(index + 1, Value::new(None, ValueKind::Nil));
}

Some(&mut array[index])
Expand Down Expand Up @@ -238,7 +237,7 @@ impl Expression {
if let ValueKind::Array(ref mut array) = parent.kind {
let uindex = sindex_to_uindex(index, array.len());
if uindex >= array.len() {
array.resize((uindex + 1) as usize, Value::new(None, ValueKind::Nil));
array.resize(uindex + 1, Value::new(None, ValueKind::Nil));
}

array[uindex] = value;
Expand Down

0 comments on commit 040958c

Please sign in to comment.