@@ -274,7 +274,10 @@ impl<T> RawVec<T> {
274
274
let ptr = if self . cap == 0 {
275
275
heap:: allocate ( new_alloc_size, align)
276
276
} else {
277
- heap:: reallocate ( self . ptr ( ) as * mut _ , self . cap * elem_size, new_alloc_size, align)
277
+ heap:: reallocate ( self . ptr ( ) as * mut _ ,
278
+ self . cap * elem_size,
279
+ new_alloc_size,
280
+ align)
278
281
} ;
279
282
280
283
// If allocate or reallocate fail, we'll get `null` back
@@ -358,7 +361,10 @@ impl<T> RawVec<T> {
358
361
let ptr = if self . cap == 0 {
359
362
heap:: allocate ( new_alloc_size, align)
360
363
} else {
361
- heap:: reallocate ( self . ptr ( ) as * mut _ , self . cap * elem_size, new_alloc_size, align)
364
+ heap:: reallocate ( self . ptr ( ) as * mut _ ,
365
+ self . cap * elem_size,
366
+ new_alloc_size,
367
+ align)
362
368
} ;
363
369
364
370
// If allocate or reallocate fail, we'll get `null` back
@@ -392,7 +398,8 @@ impl<T> RawVec<T> {
392
398
}
393
399
394
400
// This check is my waterloo; it's the only thing Vec wouldn't have to do.
395
- assert ! ( self . cap >= amount, "Tried to shrink to a larger capacity" ) ;
401
+ assert ! ( self . cap >= amount,
402
+ "Tried to shrink to a larger capacity" ) ;
396
403
397
404
if amount == 0 {
398
405
mem:: replace ( self , RawVec :: new ( ) ) ;
@@ -466,6 +473,7 @@ impl<T> Drop for RawVec<T> {
466
473
#[ inline]
467
474
fn alloc_guard ( alloc_size : usize ) {
468
475
if core:: usize:: BITS < 64 {
469
- assert ! ( alloc_size <= :: core:: isize :: MAX as usize , "capacity overflow" ) ;
476
+ assert ! ( alloc_size <= :: core:: isize :: MAX as usize ,
477
+ "capacity overflow" ) ;
470
478
}
471
479
}
0 commit comments