take method

  1. @override
Option<T> take()
override

Takes the value out of this OnceCell, moving it back to an uninitialized state.

Implementation

@override
Option<T> take() {
  if (_val == null) {
    return None;
  }
  final val = _val;
  _val = null;
  return Some(val!);
}