about summary refs log tree commit diff
path: root/src/libcore/option.rs
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2012-01-18 22:37:22 -0800
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-01-18 23:17:34 -0800
commit04a2887f8791bb080b4e76a55949a7c1954dbb97 (patch)
treef072b2cc1e0b41270041a3a10a4fc313d3fa1a89 /src/libcore/option.rs
parentca7cfbe3d0251766217e5d4e559903e655e7549b (diff)
downloadrust-04a2887f8791bb080b4e76a55949a7c1954dbb97.tar.gz
rust-04a2887f8791bb080b4e76a55949a7c1954dbb97.zip
Remove '.' after nullary tags in patterns
Does what it says on the tin.

The next commit will remove support for this syntax.
Diffstat (limited to 'src/libcore/option.rs')
-rw-r--r--src/libcore/option.rs12
1 files changed, 6 insertions, 6 deletions
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<T: copy>(opt: t<T>) -> T {
-    alt opt { some(x) { ret x; } none. { fail "option none"; } }
+    alt opt { some(x) { ret x; } none { fail "option none"; } }
 }
 
 /*
 */
 fn map<T, U: copy>(opt: t<T>, f: block(T) -> U) -> t<U> {
-    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<T>(opt: t<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<T: copy>(def: T, opt: t<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<T, U: copy>(def: U, opt: t<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<T>(opt: t<T>, f: block(T)) {
-    alt opt { none. {/* nothing */ } some(t) { f(t); } }
+    alt opt { none {/* nothing */ } some(t) { f(t); } }
 }
 
 #[test]