Skip to content

Commit

Permalink
Rollup merge of rust-lang#84294 - WaffleLapkin:patch-2, r=jonas-schie…
Browse files Browse the repository at this point in the history
…vink

Slightly change wording in doc comment and fix typo in vec/mod.rs

Suggested by ``@pickfire`` in rust-lang#82760
  • Loading branch information
GuillaumeGomez authored Apr 18, 2021
2 parents 7aa3a8e + 3ecaf57 commit 9ef82b6
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 @@ -2041,7 +2041,7 @@ impl<T, A: Allocator> Vec<T, A> {

/// Safety: changing returned .2 (&mut usize) is considered the same as calling `.set_len(_)`.
///
/// This method is used to have unique access to all vec parts at once in `extend_from_within`.
/// This method provides unique access to all vec parts at once in `extend_from_within`.
unsafe fn split_at_spare_mut_with_len(
&mut self,
) -> (&mut [T], &mut [MaybeUninit<T>], &mut usize) {
Expand Down Expand Up @@ -2279,7 +2279,7 @@ impl<T: Clone, A: Allocator> ExtendFromWithinSpec for Vec<T, A> {
iter::zip(to_clone, spare)
.map(|(src, dst)| dst.write(src.clone()))
// Note:
// - Element was just initialized with `MaybeUninit::write`, so it's ok to increace len
// - Element was just initialized with `MaybeUninit::write`, so it's ok to increase len
// - len is increased after each element to prevent leaks (see issue #82533)
.for_each(|_| *len += 1);
}
Expand Down

0 comments on commit 9ef82b6

Please sign in to comment.