expect method

T expect(
  1. String message
)

Returns the held value of this Option if it is Some, or throws OptionError with the given message if this Option is None.

See also: Rust: Option::expect()

Implementation

T expect(String message) => switch (this) {
	Some(value: T value) => value,
	None() => throw OptionError(message, isExpected: true)
};