diff options
| author | 2022-08-24 14:46:36 +0200 | |
|---|---|---|
| committer | 2022-08-24 14:46:36 +0200 | |
| commit | 9f320002800b0a8b7601528334f97ba64182bdd6 (patch) | |
| tree | eef77343a2ffbd74916d305610ff1e758467840c /src/option.hff | |
| parent | 53fcd5e1647fb56511bbdd98925dd38a84fd7248 (diff) | |
more llvm
Diffstat (limited to 'src/option.hff')
| -rw-r--r-- | src/option.hff | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/option.hff b/src/option.hff index f0eddfc..7b935dc 100644 --- a/src/option.hff +++ b/src/option.hff @@ -5,4 +5,11 @@ enum union Option<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; + } + } } |