Cleanup liballoc use statements
Some modules were still using the deprecated `allocator` module, use the `alloc` module instead. Some modules were using `super` while it's not needed. Some modules were more or less ordering them, and other not, so the latter have been modified to match the others.
This commit is contained in:
parent
9c2bfcbea2
commit
bd9ff8476d
6 changed files with 15 additions and 15 deletions
|
@ -55,8 +55,6 @@
|
|||
|
||||
#![stable(feature = "rust1", since = "1.0.0")]
|
||||
|
||||
use raw_vec::RawVec;
|
||||
|
||||
use core::any::Any;
|
||||
use core::borrow;
|
||||
use core::cmp::Ordering;
|
||||
|
@ -68,6 +66,8 @@ use core::mem::{self, Pin};
|
|||
use core::ops::{CoerceUnsized, Deref, DerefMut, Generator, GeneratorState};
|
||||
use core::ptr::{self, NonNull, Unique};
|
||||
use core::convert::From;
|
||||
|
||||
use raw_vec::RawVec;
|
||||
use str::from_boxed_utf8_unchecked;
|
||||
|
||||
/// A pointer type for heap allocation.
|
||||
|
|
|
@ -8,15 +8,16 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use alloc::{Alloc, Layout, Global};
|
||||
use core::cmp;
|
||||
use core::mem;
|
||||
use core::ops::Drop;
|
||||
use core::ptr::{self, NonNull, Unique};
|
||||
use core::slice;
|
||||
use super::boxed::Box;
|
||||
use super::allocator::CollectionAllocErr;
|
||||
use super::allocator::CollectionAllocErr::*;
|
||||
|
||||
use alloc::{Alloc, Layout, Global};
|
||||
use alloc::CollectionAllocErr;
|
||||
use alloc::CollectionAllocErr::*;
|
||||
use boxed::Box;
|
||||
|
||||
/// A low-level utility for more ergonomically allocating, reallocating, and deallocating
|
||||
/// a buffer of memory on the heap without having to worry about all the corner cases
|
||||
|
|
|
@ -46,12 +46,12 @@ use core::mem;
|
|||
use core::ptr;
|
||||
use core::iter::FusedIterator;
|
||||
|
||||
use vec_deque::VecDeque;
|
||||
use borrow::{Borrow, ToOwned};
|
||||
use boxed::Box;
|
||||
use slice::{SliceConcatExt, SliceIndex};
|
||||
use string::String;
|
||||
use vec::Vec;
|
||||
use slice::{SliceConcatExt, SliceIndex};
|
||||
use boxed::Box;
|
||||
use vec_deque::VecDeque;
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub use core::str::{FromStr, Utf8Error};
|
||||
|
|
|
@ -66,11 +66,11 @@ use core::ptr;
|
|||
use core::str::pattern::Pattern;
|
||||
use core::str::lossy;
|
||||
|
||||
use alloc::CollectionAllocErr;
|
||||
use borrow::{Cow, ToOwned};
|
||||
use boxed::Box;
|
||||
use str::{self, from_boxed_utf8_unchecked, FromStr, Utf8Error, Chars};
|
||||
use vec::Vec;
|
||||
use boxed::Box;
|
||||
use super::allocator::CollectionAllocErr;
|
||||
|
||||
/// A UTF-8 encoded, growable string.
|
||||
///
|
||||
|
|
|
@ -82,11 +82,11 @@ use core::ptr;
|
|||
use core::ptr::NonNull;
|
||||
use core::slice;
|
||||
|
||||
use alloc::CollectionAllocErr;
|
||||
use borrow::ToOwned;
|
||||
use borrow::Cow;
|
||||
use boxed::Box;
|
||||
use raw_vec::RawVec;
|
||||
use super::allocator::CollectionAllocErr;
|
||||
|
||||
/// A contiguous growable array type, written `Vec<T>` but pronounced 'vector'.
|
||||
///
|
||||
|
|
|
@ -30,10 +30,9 @@ use core::slice;
|
|||
use core::hash::{Hash, Hasher};
|
||||
use core::cmp;
|
||||
|
||||
use alloc::CollectionAllocErr;
|
||||
use raw_vec::RawVec;
|
||||
|
||||
use super::allocator::CollectionAllocErr;
|
||||
use super::vec::Vec;
|
||||
use vec::Vec;
|
||||
|
||||
const INITIAL_CAPACITY: usize = 7; // 2^3 - 1
|
||||
const MINIMUM_CAPACITY: usize = 1; // 2 - 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue