diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-10-27 18:15:58 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-10-27 18:15:58 -0700 |
| commit | b16d9019a8c0b0e7950bd897e8b59136c2d98642 (patch) | |
| tree | 98c94aa8c10d6ac85268af8310c71d0ffb934db3 | |
| parent | 91997e79aae73472704248eb0a5089a79b4d3e83 (diff) | |
Make option::is_some option::is_none pure
| -rw-r--r-- | src/lib/option.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/option.rs b/src/lib/option.rs index 970349c7d31..5121e3f7d08 100644 --- a/src/lib/option.rs +++ b/src/lib/option.rs @@ -45,7 +45,7 @@ Function: is_none Returns true if the option equals none */ -fn is_none<T>(opt: t<T>) -> bool { +pure fn is_none<T>(opt: t<T>) -> bool { alt opt { none. { true } some(_) { false } } } @@ -54,7 +54,7 @@ Function: is_some Returns true if the option contains some value */ -fn is_some<T>(opt: t<T>) -> bool { !is_none(opt) } +pure fn is_some<T>(opt: t<T>) -> bool { !is_none(opt) } /* Function: from_maybe |
