@@ -25,13 +25,13 @@ pure fn get<T: copy>(opt: option<T>) -> T {
2525 alt opt { some( x) { ret x; } none { fail "option none" ; } }
2626}
2727
28- fn map < T , U : copy > ( opt : option < T > , f : fn ( T ) -> U ) -> option < U > {
28+ pure fn map<T , U : copy>( opt: option<T >, f: fn ( T ) -> U ) -> option<U > {
2929 #[ doc = "Maps a `some` value from one type to another" ] ;
3030
3131 alt opt { some( x) { some ( f ( x) ) } none { none } }
3232}
3333
34- fn chain < T , U > ( opt : option < T > , f : fn ( T ) -> option < U > ) -> option < U > {
34+ pure fn chain<T , U >( opt: option<T >, f: fn ( T ) -> option<U >) -> option<U > {
3535 #[ doc = "
3636 Update an optional value by optionally running its content through a
3737 function that returns an option.
@@ -58,19 +58,19 @@ pure fn get_default<T: copy>(opt: option<T>, def: T) -> T {
5858 alt opt { some( x) { x } none { def } }
5959}
6060
61- fn map_default<T , U : copy>( opt: option<T >, def: U , f : fn ( T ) -> U ) -> U {
61+ pure fn map_default<T , U : copy>( opt: option<T >, def: U , f : fn ( T ) -> U ) -> U {
6262 #[ doc = "Applies a function to the contained value or returns a default" ] ;
6363
6464 alt opt { none { def } some( t) { f ( t) } }
6565}
6666
67- fn iter<T >( opt: option<T >, f : fn ( T ) ) {
67+ pure fn iter<T >( opt: option<T >, f : fn ( T ) ) {
6868 #[ doc = "Performs an operation on the contained value or does nothing" ] ;
6969
7070 alt opt { none { } some( t) { f ( t) ; } }
7171}
7272
73- fn unwrap<T >( -opt: option<T >) -> T unsafe {
73+ pure fn unwrap<T >( -opt: option<T >) -> T unsafe {
7474 #[ doc = "
7575 Moves a value out of an option type and returns it.
7676
0 commit comments