splitFirst method

Option<(T, Slice<T>)> splitFirst()

Returns the first and all the rest of the elements of the slice, or None if it is empty.

Implementation

Option<(T, Slice<T>)> splitFirst() {
  if (isEmpty) {
    return None;
  }
  var element = _list[_start];
  _start++;
  return Some((element, Slice(_list, _start, _end)));
}