pub fn clear(&mut self) {
        self.items.clear();

        let end = self.items.capacity() as u32;
        self.items.extend((0..end).map(|i| {
            if i == end - 1 {
                Entry::Free { next_free: None }
            } else {
                Entry::Free {
                    next_free: Some(i + 1),
                }
            }
        }));
        self.free_list_head = Some(0);
        self.len = 0;
    }
/// Clear all the items inside the arena, but keep its allocation.
///
/// # Examples
///
/// ```ignore
/// use rapier::data::arena::Arena;
///
/// let mut arena = Arena::with_capacity(1);
/// arena.insert(42);
/// arena.insert(43);
///
/// arena.clear();
///
/// assert_eq!(arena.capacity(), 2);
/// ```
Clear all the items inside the arena, but keep its allocation.
Clear all the items inside the arena but keep its allocation .
pub fn clear(&mut self) {
        self.items.clear();
        let end = self.items.capacity() as u32;
        self.items.extend((0..end).map(|i| {
            if i == end - 1 {
                Entry::Free { next_free: None }
            } else {
                Entry::Free {
                    next_free: Some(i + 1),
                }
            }
        }));
        self.free_list_head = Some(0);
        self.len = 0;
    }
pub fn clear ( & mut self ) { self . items . clear ( ) ; let end = self . items . capacity ( ) as u32 ; self . items . extend ( ( 0 .. end ) . map ( | i | { if i == end - 1 { Entry :: Free { next_free : None } } else { Entry :: Free { next_free : Some ( i + 1 ) , } } } ) ) ; self . free_list_head = Some ( 0 ) ; self . len = 0 ; }
Clear all the items inside the arena, but keep its allocation.
Clear all the items inside the arena but keep its allocation .
&mut self
examples
```ignore
use rapier::data::arena::Arena.

let mut arena = Arena::with_capacity(1);
arena.insert(42);
arena.insert(43).

arena.clear().


` ` ` ignore use rapier :: data :: arena :: Arena . let mut arena = Arena :: with_capacity ( 1 ) ; arena . insert ( 42 ) ; arena . insert ( 43 ) . arena . clear () .