We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f04beb commit cad4a13Copy full SHA for cad4a13
vm/src/function.rs
@@ -361,6 +361,23 @@ impl<T> OptionalArg<T> {
361
Missing => None,
362
}
363
364
+
365
+ pub fn unwrap_or(self, default: T) -> T {
366
+ match self {
367
+ Present(value) => value,
368
+ Missing => default,
369
+ }
370
371
372
+ pub fn unwrap_or_else<F>(self, f: F) -> T
373
+ where
374
+ F: FnOnce() -> T,
375
+ {
376
377
378
+ Missing => f(),
379
380
381
382
383
impl<T> FromArgs for OptionalArg<T>
0 commit comments