From 04a2887f8791bb080b4e76a55949a7c1954dbb97 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Wed, 18 Jan 2012 22:37:22 -0800 Subject: Remove '.' after nullary tags in patterns Does what it says on the tin. The next commit will remove support for this syntax. --- src/libcore/option.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/libcore/option.rs') diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 1dcfed5bc36..89d1171e1d6 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -31,13 +31,13 @@ Failure: Fails if the value equals `none`. */ pure fn get(opt: t) -> T { - alt opt { some(x) { ret x; } none. { fail "option none"; } } + alt opt { some(x) { ret x; } none { fail "option none"; } } } /* */ fn map(opt: t, f: block(T) -> U) -> t { - alt opt { some(x) { some(f(x)) } none. { none } } + alt opt { some(x) { some(f(x)) } none { none } } } /* @@ -46,7 +46,7 @@ Function: is_none Returns true if the option equals none */ pure fn is_none(opt: t) -> bool { - alt opt { none. { true } some(_) { false } } + alt opt { none { true } some(_) { false } } } /* @@ -62,7 +62,7 @@ Function: from_maybe Returns the contained value or a default */ pure fn from_maybe(def: T, opt: t) -> T { - alt opt { some(x) { x } none. { def } } + alt opt { some(x) { x } none { def } } } /* @@ -71,7 +71,7 @@ Function: maybe Applies a function to the contained value or returns a default */ fn maybe(def: U, opt: t, f: block(T) -> U) -> U { - alt opt { none. { def } some(t) { f(t) } } + alt opt { none { def } some(t) { f(t) } } } // FIXME: Can be defined in terms of the above when/if we have const bind. @@ -81,7 +81,7 @@ Function: may Performs an operation on the contained value or does nothing */ fn may(opt: t, f: block(T)) { - alt opt { none. {/* nothing */ } some(t) { f(t); } } + alt opt { none {/* nothing */ } some(t) { f(t); } } } #[test] -- cgit 1.4.1-3-g733a5