pub fn allocate(&mut self) -> Option<T> {
        if let Some(free) = self.free_list.pop() {
            Some(free)
        } else {
            if let Some(last) = self.last_allocated {
                if let Some(next) = last.checked_add(&T::one()) {
                    // Allocate the next integer.
                    self.last_allocated = Some(next);
                    self.last_allocated
                } else {
                    // Ran out of integers.
                    None
                }
            } else {
                // Allocate zero.
                self.last_allocated = Some(T::zero());
                self.last_allocated
            }
        }
    }
/// Returns an integer not currently allocated, or `None` if all nonnegative
/// integers of type `T` are already allocated.
Returns an integer not currently allocated, or `None` if all nonnegative
integers of type `T` are already allocated.
Returns an integer not currently allocated or ` None ` if all nonnegative integers of type ` T ` are already allocated .
pub fn allocate(&mut self) -> Option<T> {
        if let Some(free) = self.free_list.pop() {
            Some(free)
        } else {
            if let Some(last) = self.last_allocated {
                if let Some(next) = last.checked_add(&T::one()) {
                    // Allocate the next integer.
                    self.last_allocated = Some(next);
                    self.last_allocated
                } else {
                    // Ran out of integers.
                    None
                }
            } else {
                // Allocate zero.
                self.last_allocated = Some(T::zero());
                self.last_allocated
            }
        }
    }
pub fn allocate ( & mut self ) -> Option < T > { if let Some ( free ) = self . free_list . pop ( ) { Some ( free ) } else { if let Some ( last ) = self . last_allocated { if let Some ( next ) = last . checked_add ( & T :: one ( ) ) { // Allocate the next integer. self . last_allocated = Some ( next ) ; self . last_allocated } else { // Ran out of integers. None } } else { // Allocate zero. self . last_allocated = Some ( T :: zero ( ) ) ; self . last_allocated } } }
Returns an integer not currently allocated, or `None` if all nonnegative
integers of type `T` are already allocated.
Returns an integer not currently allocated or ` None ` if all nonnegative integers of type ` T ` are already allocated .
&mut self