popOpt method
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());
}
Removes the last element from the Vec and returns it, or None if it is empty.
Option<T> popOpt() {
if (isEmpty) {
return None;
}
return Some(removeLast());
}