File tree Expand file tree Collapse file tree 3 files changed +3
-12
lines changed Expand file tree Collapse file tree 3 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -707,10 +707,7 @@ impl<T: TransparentPtrType> PtrSlice<T> {
707
707
let new_capacity =
708
708
usize:: next_power_of_two ( std:: cmp:: max ( self . len + additional, MIN_SIZE ) + 1 ) ;
709
709
assert_ne ! ( new_capacity, 0 ) ;
710
-
711
- if new_capacity <= self . capacity {
712
- return ;
713
- }
710
+ assert ! ( new_capacity > self . capacity) ;
714
711
715
712
unsafe {
716
713
let ptr = if self . capacity == 0 {
Original file line number Diff line number Diff line change @@ -623,10 +623,7 @@ impl<T: TransparentType> Slice<T> {
623
623
MIN_SIZE / mem:: size_of :: < T > ( ) ,
624
624
) ) ;
625
625
assert_ne ! ( new_capacity, 0 ) ;
626
-
627
- if new_capacity <= self . capacity {
628
- return ;
629
- }
626
+ assert ! ( new_capacity > self . capacity) ;
630
627
631
628
unsafe {
632
629
let ptr = if self . capacity == 0 {
Original file line number Diff line number Diff line change @@ -667,10 +667,7 @@ impl StrV {
667
667
let new_capacity =
668
668
usize:: next_power_of_two ( std:: cmp:: max ( self . len + additional, MIN_SIZE ) + 1 ) ;
669
669
assert_ne ! ( new_capacity, 0 ) ;
670
-
671
- if new_capacity <= self . capacity {
672
- return ;
673
- }
670
+ assert ! ( new_capacity > self . capacity) ;
674
671
675
672
unsafe {
676
673
let ptr = if self . capacity == 0 {
You can’t perform that action at this time.
0 commit comments