diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-04 09:30:44 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-04 11:38:09 +0100 |
| commit | eb951c008beea502042db4a3a0e8d1f8b51f6f52 (patch) | |
| tree | 9856ee4ed0222222669de10e616a580b2a60135e /src/model/array.rs | |
| parent | 33928a00dc58250e24da1dae4e5db17e7b598d70 (diff) | |
Style changes
Diffstat (limited to 'src/model/array.rs')
| -rw-r--r-- | src/model/array.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/model/array.rs b/src/model/array.rs index 053248ec..40b063e2 100644 --- a/src/model/array.rs +++ b/src/model/array.rs @@ -119,7 +119,7 @@ impl Array { .ok_or_else(|| out_of_bounds(end, len))? .max(start); - Ok(Self::from_vec(self.0[start .. end].to_vec())) + Ok(Self::from_vec(self.0[start..end].to_vec())) } /// Whether the array contains a specific value. @@ -287,12 +287,8 @@ impl Array { /// Resolve an index. fn locate(&self, index: i64) -> Option<usize> { - usize::try_from(if index >= 0 { - index - } else { - self.len().checked_add(index)? - }) - .ok() + usize::try_from(if index >= 0 { index } else { self.len().checked_add(index)? }) + .ok() } } |
