diff options
| author | Ahmed Charles <acharles@outlook.com> | 2015-10-11 22:11:59 -0700 |
|---|---|---|
| committer | Ahmed Charles <acharles@outlook.com> | 2015-10-11 22:11:59 -0700 |
| commit | 5dcd4061880b3ce9e97a7dc6638360540bf6d4f7 (patch) | |
| tree | 087921e037fddabec0781f00ffb4ca20cb17b46c /src/liballoc/raw_vec.rs | |
| parent | 81b3b27cf533e50424f749d1c1db23e5d8db952f (diff) | |
| download | rust-5dcd4061880b3ce9e97a7dc6638360540bf6d4f7.tar.gz rust-5dcd4061880b3ce9e97a7dc6638360540bf6d4f7.zip | |
Run rustfmt on liballoc.
Diffstat (limited to 'src/liballoc/raw_vec.rs')
| -rw-r--r-- | src/liballoc/raw_vec.rs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/liballoc/raw_vec.rs b/src/liballoc/raw_vec.rs index 49d37698154..4df3bacdcb6 100644 --- a/src/liballoc/raw_vec.rs +++ b/src/liballoc/raw_vec.rs @@ -65,7 +65,10 @@ impl<T> RawVec<T> { }; // heap::EMPTY doubles as "unallocated" and "zero-sized allocation" - RawVec { ptr: Unique::new(heap::EMPTY as *mut T), cap: cap } + RawVec { + ptr: Unique::new(heap::EMPTY as *mut T), + cap: cap, + } } } @@ -102,7 +105,10 @@ impl<T> RawVec<T> { ptr }; - RawVec { ptr: Unique::new(ptr as *mut _), cap: cap } + RawVec { + ptr: Unique::new(ptr as *mut _), + cap: cap, + } } } @@ -114,7 +120,10 @@ impl<T> RawVec<T> { /// capacity cannot exceed `isize::MAX` (only a concern on 32-bit systems). /// If the ptr and capacity come from a RawVec, then this is guaranteed. pub unsafe fn from_raw_parts(ptr: *mut T, cap: usize) -> Self { - RawVec { ptr: Unique::new(ptr), cap: cap } + RawVec { + ptr: Unique::new(ptr), + cap: cap, + } } /// Converts a `Box<[T]>` into a `RawVec<T>`. @@ -398,8 +407,7 @@ impl<T> RawVec<T> { } // This check is my waterloo; it's the only thing Vec wouldn't have to do. - assert!(self.cap >= amount, - "Tried to shrink to a larger capacity"); + assert!(self.cap >= amount, "Tried to shrink to a larger capacity"); if amount == 0 { mem::replace(self, RawVec::new()); |
