Skip to content
This repository was archived by the owner on Nov 27, 2020. It is now read-only.

Commit 4358c2c

Browse files
committed
Remove Vec::..._zeroed API
1 parent 8ca1f50 commit 4358c2c

File tree

1 file changed

+0
-53
lines changed

1 file changed

+0
-53
lines changed

src/vec.rs

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -404,22 +404,6 @@ impl<T> Vec<T> {
404404
Self::with_capacity_in(capacity, AbortAlloc(Global))
405405
}
406406

407-
/// Like `with_capacity`, but guarantees the buffer is zeroed.
408-
///
409-
/// # Panics
410-
///
411-
/// * if the requested capacity exceeds `usize::MAX` bytes.
412-
/// * on 32-bit platforms if the requested capacity exceeds `isize::MAX` bytes.
413-
///
414-
/// # Aborts
415-
///
416-
/// * on OOM
417-
#[inline]
418-
#[must_use]
419-
pub fn with_capacity_zeroed(capacity: usize) -> Self {
420-
Self::with_capacity_zeroed_in(capacity, AbortAlloc(Global))
421-
}
422-
423407
/// Creates a `Vec<T>` directly from the raw components of another vector.
424408
///
425409
/// # Safety
@@ -533,43 +517,6 @@ impl<T, A: DeallocRef> Vec<T, A> {
533517
})
534518
}
535519

536-
#[inline]
537-
/// Like `with_capacity_zeroed` but parameterized over the choice of allocator for the returned
538-
/// `Vec`.
539-
///
540-
/// # Panics
541-
///
542-
/// * if the requested capacity exceeds `usize::MAX` bytes.
543-
/// * on 32-bit platforms if the requested capacity exceeds `isize::MAX` bytes.
544-
pub fn with_capacity_zeroed_in(capacity: usize, a: A) -> Self
545-
where
546-
A: AllocRef<Error = !>,
547-
{
548-
Self {
549-
buf: RawVec::with_capacity_zeroed_in(capacity, a),
550-
len: 0,
551-
}
552-
}
553-
554-
#[inline]
555-
/// Like `with_capacity_zeroed` but parameterized over the choice of allocator for the returned
556-
/// `Vec`.
557-
///
558-
/// # Errors
559-
///
560-
/// * `CapacityOverflow` if the requested capacity exceeds `usize::MAX` bytes.
561-
/// * `CapacityOverflow` on 32-bit platforms if the requested capacity exceeds `isize::MAX` bytes.
562-
/// * `AllocError` on OOM
563-
pub fn try_with_capacity_zeroed_in(capacity: usize, a: A) -> Result<Self, CollectionAllocErr<A>>
564-
where
565-
A: AllocRef,
566-
{
567-
Ok(Self {
568-
buf: RawVec::try_with_capacity_zeroed_in(capacity, a)?,
569-
len: 0,
570-
})
571-
}
572-
573520
/// Like `from_raw_parts` but parameterized over the choice of allocator for the returned
574521
/// `Vec`.
575522
/// # Safety

0 commit comments

Comments
 (0)