@@ -266,7 +266,7 @@ impl<T, const N: usize> ArrayVec<T, { N }> {
266
266
}
267
267
268
268
unsafe {
269
- self . insert_unchecked ( index, item, len ) ;
269
+ self . insert_unchecked ( index, item) ;
270
270
}
271
271
272
272
Ok ( ( ) )
@@ -333,7 +333,7 @@ impl<T, const N: usize> ArrayVec<T, { N }> {
333
333
// Since nothing's going to be removed, the vector's size
334
334
// is going to be increased and nothing will be returned.
335
335
unsafe {
336
- self . insert_unchecked ( index, item, len ) ;
336
+ self . insert_unchecked ( index, item) ;
337
337
}
338
338
result = None ;
339
339
}
@@ -342,20 +342,16 @@ impl<T, const N: usize> ArrayVec<T, { N }> {
342
342
}
343
343
344
344
/// Insert an item into the vector without checking if the index is
345
- /// valid or if the vector isn't full or the vector's length .
345
+ /// valid or if the vector isn't full.
346
346
///
347
347
/// # Safety
348
348
///
349
349
/// If you plan on using this function, you need to check for the
350
- /// 3 previously mentioned conditions yourself before calling this
350
+ /// 2 previously mentioned conditions yourself before calling this
351
351
/// method.
352
352
#[ inline]
353
- pub unsafe fn insert_unchecked (
354
- & mut self ,
355
- index : usize ,
356
- item : T ,
357
- len : usize ,
358
- ) {
353
+ pub unsafe fn insert_unchecked ( & mut self , index : usize , item : T ) {
354
+ let len = self . len ( ) ;
359
355
self . insert_unchecked_keep_len ( index, item, len) ;
360
356
self . set_len ( len + 1 ) ;
361
357
}
0 commit comments