Skip to content

Commit b16d901

Browse files
committed
Make option::is_some option::is_none pure
1 parent 91997e7 commit b16d901

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/option.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Function: is_none
4545
4646
Returns true if the option equals none
4747
*/
48-
fn is_none<T>(opt: t<T>) -> bool {
48+
pure fn is_none<T>(opt: t<T>) -> bool {
4949
alt opt { none. { true } some(_) { false } }
5050
}
5151

@@ -54,7 +54,7 @@ Function: is_some
5454
5555
Returns true if the option contains some value
5656
*/
57-
fn is_some<T>(opt: t<T>) -> bool { !is_none(opt) }
57+
pure fn is_some<T>(opt: t<T>) -> bool { !is_none(opt) }
5858

5959
/*
6060
Function: from_maybe

0 commit comments

Comments
 (0)