Skip to content

Commit

Permalink
Update new usage of assert_len
Browse files Browse the repository at this point in the history
  • Loading branch information
dylni committed Feb 13, 2021
1 parent 5d519ea commit fe4fe19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2036,11 +2036,11 @@ impl<T: Clone, A: Allocator> Vec<T, A> {
where
R: RangeBounds<usize>,
{
let range = src.assert_len(self.len());
let range = slice::range(src, ..self.len());
self.reserve(range.len());

// SAFETY:
// - `assert_len` guarantees that the given range is valid for indexing self
// - `slice::range` guarantees that the given range is valid for indexing self
unsafe {
self.spec_extend_from_within(range);
}
Expand Down

0 comments on commit fe4fe19

Please sign in to comment.