mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
Make option::is_some option::is_none pure
This commit is contained in:
+2
-2
@@ -45,7 +45,7 @@ fn map<T, U>(f: block(T) -> U, opt: t<T>) -> t<U> {
|
||||
|
||||
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 @@ fn is_none<T>(opt: t<T>) -> bool {
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user