Skip to content

Commit

Permalink
update array_vec to use new rangeargument
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed Jan 14, 2017
1 parent 4920721 commit 93e6c26
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/librustc_data_structures/array_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 93e6c26

Please sign in to comment.