update array_vec to use new rangeargument
This commit is contained in:
parent
4920721f6c
commit
93e6c26dcf
@ -119,8 +119,16 @@ impl<A: Array> ArrayVec<A> {
|
||||
// the hole, and the vector length is restored to the new length.
|
||||
//
|
||||
let len = self.len();
|
||||
let start = *range.start().unwrap_or(&0);
|
||||
let end = *range.end().unwrap_or(&len);
|
||||
let start = match range.start() {
|
||||
Included(&n) => n,
|
||||
Excluded(&n) => n + 1,
|
||||
Unbounded => 0,
|
||||
};
|
||||
let end = match range.end() {
|
||||
Included(&n) => n + 1,
|
||||
Excluded(&n) => n,
|
||||
Unbounded => len,
|
||||
};
|
||||
assert!(start <= end);
|
||||
assert!(end <= len);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user