popOpt method

Option<T> popOpt()

Removes the last element from the Vec and returns it, or None if it is empty.

Implementation

Option<T> popOpt() {
  if (isEmpty) {
    return None;
  }
  return Some(removeLast());
}