blob: 7b935dcf0c7fbde84b1af10bd8ff3cf4ece5ad0a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
enum union Option<T> {
None,
Some T,
fn empty(self Option) bool {
return self.#tag == :None;
}
fn some_or(self Option, it T) T {
switch self {
case None; return it;
case Some x; return x;
}
}
}
|