next method

  1. @override
Option<T> next()

If the iterator is empty, returns None. Otherwise, returns the next value wrapped in Some.

Implementation

@override
Option<T> next() {
  if (moveNext()) {
    return Some(current);
  }
  return None;
}