Skip to content

Commit 0c443cf

Browse files
committed
rename function
1 parent 8a0a13a commit 0c443cf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/alloc/src/vec.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,7 +2200,7 @@ impl<T> SpecFromIter<T, IntoIter<T>> for Vec<T> {
22002200
let has_advanced = iterator.buf.as_ptr() as *const _ != iterator.ptr;
22012201
if !has_advanced || iterator.len() >= iterator.cap / 2 {
22022202
// Safety: passing 0 is always valid
2203-
return unsafe { iterator.into_vec(0) };
2203+
return unsafe { iterator.into_vec_with_uninit_prefix(0) };
22042204
}
22052205

22062206
let mut vec = Vec::new();
@@ -2394,7 +2394,7 @@ impl<T> SpecExtend<T, IntoIter<T>> for Vec<T> {
23942394
// Safety: we just checked that IntoIter has sufficient capacity to prepend our elements.
23952395
// Prepending will then fill the uninitialized prefix.
23962396
*self = unsafe {
2397-
let mut v = iterator.into_vec(self.len() as isize);
2397+
let mut v = iterator.into_vec_with_uninit_prefix(self.len() as isize);
23982398
ptr::copy_nonoverlapping(self.as_ptr(), v.as_mut_ptr(), self.len);
23992399
self.set_len(0);
24002400
v
@@ -2946,7 +2946,7 @@ impl<T> IntoIter<T> {
29462946
/// * `offset + self.len()` must not exceed `self.cap`
29472947
/// * `offset == 0` is always valid
29482948
/// * `offset` must be positive
2949-
unsafe fn into_vec(self, offset: isize) -> Vec<T> {
2949+
unsafe fn into_vec_with_uninit_prefix(self, offset: isize) -> Vec<T> {
29502950
let dst = unsafe { self.buf.as_ptr().offset(offset) };
29512951
if self.ptr != dst as *const _ {
29522952
unsafe { ptr::copy(self.ptr, dst, self.len()) }

0 commit comments

Comments
 (0)