diff options
| author | bors <bors@rust-lang.org> | 2020-10-18 18:50:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-10-18 18:50:43 +0000 |
| commit | 187b8771dca797ccac6b5c8a87db1c3afd11172e (patch) | |
| tree | 92b7e614a381aa8b4acb97723500e364162ed1f1 /library/alloc/src/vec.rs | |
| parent | 4d247ad7d3d2a9f72cd60e281f39b5d85bd6a463 (diff) | |
| parent | f055b0bb0847ecf08fe452a270faae8324b55b05 (diff) | |
| download | rust-187b8771dca797ccac6b5c8a87db1c3afd11172e.tar.gz rust-187b8771dca797ccac6b5c8a87db1c3afd11172e.zip | |
Auto merge of #76885 - dylni:move-slice-check-range-to-range-bounds, r=KodrAus
Move `slice::check_range` to `RangeBounds` Since this method doesn't take a slice anymore (#76662), it makes more sense to define it on `RangeBounds`. Questions: - Should the new method be `assert_len` or `assert_length`?
Diffstat (limited to 'library/alloc/src/vec.rs')
| -rw-r--r-- | library/alloc/src/vec.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/alloc/src/vec.rs b/library/alloc/src/vec.rs index 805e1085cf3..8526f15288f 100644 --- a/library/alloc/src/vec.rs +++ b/library/alloc/src/vec.rs @@ -1314,7 +1314,7 @@ impl<T> Vec<T> { // the hole, and the vector length is restored to the new length. // let len = self.len(); - let Range { start, end } = slice::check_range(len, range); + let Range { start, end } = range.assert_len(len); unsafe { // set self.vec length's to start, to be safe in case Drain is leaked |
