@@ -242,6 +242,7 @@ impl<T: ArrayElement> Array<T> {
242
242
// SAFETY: The array has type `T` and we're writing a value of type `T` to it.
243
243
unsafe { self . as_inner_mut ( ) } . push_front ( value. to_variant ( ) ) ;
244
244
}
245
+
245
246
/// Removes and returns the last element of the array. Returns `None` if the array is empty.
246
247
///
247
248
/// _Godot equivalent: `pop_back`_
@@ -266,7 +267,7 @@ impl<T: ArrayElement> Array<T> {
266
267
} )
267
268
}
268
269
269
- /// Inserts a new element before the index. The index must be valid or the end of the array (`index == len()`).
270
+ /// ⚠️ Inserts a new element before the index. The index must be valid or the end of the array (`index == len()`).
270
271
///
271
272
/// On large arrays, this method is much slower than [`push()`][Self::push], as it will move all the array's elements after the inserted element.
272
273
/// The larger the array, the slower `insert()` will be.
@@ -286,12 +287,13 @@ impl<T: ArrayElement> Array<T> {
286
287
287
288
/// ⚠️ Removes and returns the element at the specified index. Equivalent of `pop_at` in GDScript.
288
289
///
289
- /// On large arrays, this method is much slower than `pop_back ()` as it will move all the array's
290
+ /// On large arrays, this method is much slower than [`pop ()`][Self::pop] as it will move all the array's
290
291
/// elements after the removed element. The larger the array, the slower `remove()` will be.
291
292
///
292
293
/// # Panics
293
294
///
294
295
/// If `index` is out of bounds.
296
+ #[ doc( alias = "pop_at" ) ]
295
297
pub fn remove ( & mut self , index : usize ) -> T {
296
298
self . check_bounds ( index) ;
297
299
@@ -304,7 +306,7 @@ impl<T: ArrayElement> Array<T> {
304
306
///
305
307
/// If the value does not exist in the array, nothing happens. To remove an element by index, use [`remove()`][Self::remove] instead.
306
308
///
307
- /// On large arrays, this method is much slower than [`pop_back ()`][Self::pop_back ], as it will move all the array's
309
+ /// On large arrays, this method is much slower than [`pop ()`][Self::pop ], as it will move all the array's
308
310
/// elements after the removed element.
309
311
pub fn erase ( & mut self , value : & T ) {
310
312
// SAFETY: We don't write anything to the array.
0 commit comments