Skip to content

Commit 0319e38

Browse files
committed
refactor(path): Clarify index operation
1 parent f51ae03 commit 0319e38

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/path/mod.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,7 @@ impl Expression {
8282
Some(value) => match value.kind {
8383
ValueKind::Array(ref array) => {
8484
let index = abs_index(index, array.len())?;
85-
86-
if index >= array.len() {
87-
None
88-
} else {
89-
Some(&array[index])
90-
}
85+
array.get(index)
9186
}
9287

9388
_ => None,

0 commit comments

Comments
 (0)