@@ -100,15 +100,15 @@ impl Buffer {
100
100
/// This method panics if `size` overflows `isize::MAX`.
101
101
#[ inline]
102
102
pub fn reserve ( & mut self , size : usize ) {
103
- assert ! ( size <= isize :: MAX as usize ) ;
103
+ assert ! ( size <= std :: isize :: MAX as usize ) ;
104
104
unsafe { self . reserve_small ( size) } ;
105
105
}
106
106
107
107
/// Same as String::reserve except that undefined behaviour can result if `size`
108
108
/// overflows `isize::MAX`.
109
109
#[ inline]
110
110
pub ( crate ) unsafe fn reserve_small ( & mut self , size : usize ) {
111
- debug_assert ! ( size <= isize :: MAX as usize ) ;
111
+ debug_assert ! ( size <= std :: isize :: MAX as usize ) ;
112
112
if self . len + size <= self . capacity {
113
113
return ;
114
114
}
@@ -161,7 +161,7 @@ impl Buffer {
161
161
#[ cfg_attr( feature = "perf-inline" , inline) ]
162
162
#[ cold]
163
163
fn reserve_internal ( & mut self , size : usize ) {
164
- debug_assert ! ( size <= isize :: MAX as usize ) ;
164
+ debug_assert ! ( size <= std :: isize :: MAX as usize ) ;
165
165
166
166
let new_capacity = std:: cmp:: max ( self . capacity * 2 , self . capacity + size) ;
167
167
debug_assert ! ( new_capacity > self . capacity) ;
@@ -176,7 +176,10 @@ impl Buffer {
176
176
#[ inline( never) ]
177
177
fn safe_alloc ( capacity : usize ) -> * mut u8 {
178
178
assert ! ( capacity > 0 ) ;
179
- assert ! ( capacity <= isize :: MAX as usize , "capacity is too large" ) ;
179
+ assert ! (
180
+ capacity <= std:: isize :: MAX as usize ,
181
+ "capacity is too large"
182
+ ) ;
180
183
181
184
// SAFETY: capacity is non-zero, and always multiple of alignment (1).
182
185
unsafe {
@@ -198,7 +201,10 @@ fn safe_alloc(capacity: usize) -> *mut u8 {
198
201
#[ inline( never) ]
199
202
unsafe fn safe_realloc ( ptr : * mut u8 , capacity : usize , new_capacity : usize ) -> * mut u8 {
200
203
assert ! ( new_capacity > 0 ) ;
201
- assert ! ( new_capacity <= isize :: MAX as usize , "capacity is too large" ) ;
204
+ assert ! (
205
+ new_capacity <= std:: isize :: MAX as usize ,
206
+ "capacity is too large"
207
+ ) ;
202
208
203
209
let data = if unlikely ! ( capacity == 0 ) {
204
210
let new_layout = Layout :: from_size_align_unchecked ( new_capacity, 1 ) ;
0 commit comments