pub fn new_node(&mut self, data: T) -> NodeId {
        let next_index1 = NonZeroUsize::new(self.nodes.len().wrapping_add(1))
            .expect("Too many nodes in the arena");
        self.nodes.push(Node::new(data));
        NodeId::from_non_zero_usize(next_index1)
    }
/// Creates a new node from its associated data.
///
/// # Panics
///
/// Panics if the arena already has `usize::max_value()` nodes.
///
/// # Examples
///
/// ```
/// # use indextree::Arena;
/// let mut arena = Arena::new();
/// let foo = arena.new_node("foo");
///
/// assert_eq!(*arena[foo].get(), "foo");
/// ```
Creates a new node from its associated data.
Creates a new node from its associated data .
pub fn new_node(&mut self, data: T) -> NodeId {
        let next_index1 = NonZeroUsize::new(self.nodes.len().wrapping_add(1))
            .expect("Too many nodes in the arena");
        self.nodes.push(Node::new(data));
        NodeId::from_non_zero_usize(next_index1)
    }
pub fn new_node ( & mut self , data : T ) -> NodeId { let next_index1 = NonZeroUsize :: new ( self . nodes . len ( ) . wrapping_add ( 1 ) ) . expect ( " " ) ; self . nodes . push ( Node :: new ( data ) ) ; NodeId :: from_non_zero_usize ( next_index1 ) }
Creates a new node from its associated data.
Creates a new node from its associated data .
&mut self
data
T
&mut self
data
T
panics
Panics if the arena already has `usize::max_value()` nodes.
Panics if the arena already has ` usize :: max_value () ` nodes .
examples
None
use indextree::arena;
let mut arena = Arena::new();
let foo = arena.new_node("foo").


let mut arena = Arena :: new () ; let foo = arena . new_node ( " foo " ) .