File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -688,7 +688,7 @@ impl<T: TransparentType> Slice<T> {
688
688
#[ inline]
689
689
pub fn extend_from_slice ( & mut self , other : & [ T ] ) {
690
690
// Nothing new to reserve as there's still enough space
691
- if self . len + other. len ( ) <= self . capacity {
691
+ if self . len + other. len ( ) > self . capacity {
692
692
self . reserve ( other. len ( ) ) ;
693
693
}
694
694
@@ -709,7 +709,7 @@ impl<T: TransparentType> Slice<T> {
709
709
assert ! ( index <= self . len) ;
710
710
711
711
// Nothing new to reserve as there's still enough space
712
- if self . len + 1 <= self . capacity {
712
+ if self . len + 1 > self . capacity {
713
713
self . reserve ( 1 ) ;
714
714
}
715
715
@@ -732,7 +732,7 @@ impl<T: TransparentType> Slice<T> {
732
732
#[ allow( clippy:: int_plus_one) ]
733
733
pub fn push ( & mut self , item : T ) {
734
734
// Nothing new to reserve as there's still enough space
735
- if self . len + 1 <= self . capacity {
735
+ if self . len + 1 > self . capacity {
736
736
self . reserve ( 1 ) ;
737
737
}
738
738
You can’t perform that action at this time.
0 commit comments