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 ee3096a commit 1cd2b30Copy full SHA for 1cd2b30
[refs]
@@ -1,2 +1,2 @@
1
---
2
-refs/heads/master: 49a4867da6ba4ef1f6ee4977b243acc0953dda25
+refs/heads/master: 0efd7fac8a3dbcf7c8bd19ea2ace05e4898bafae
trunk/src/lib/option.rs
@@ -21,6 +21,10 @@ fn is_none[T](&t[T] opt) -> bool {
21
ret alt (opt) { case (none) { true } case (some(_)) { false } };
22
}
23
24
+fn is_some[T](&t[T] opt) -> bool {
25
+ ret !is_none(opt);
26
+}
27
+
28
fn from_maybe[T](&T def, &t[T] opt) -> T {
29
auto f = bind util::id[T](_);
30
ret maybe[T, T](def, f, opt);
0 commit comments