From 45e46f5fc0e78f5855e8870a6e3eb2a0a7e5ae50 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 30 Aug 2012 10:14:54 -0700 Subject: [PATCH] libcore: Add missing unit.rs --- src/libcore/unit.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/libcore/unit.rs diff --git a/src/libcore/unit.rs b/src/libcore/unit.rs new file mode 100644 index 00000000000..e4ca11bbd8a --- /dev/null +++ b/src/libcore/unit.rs @@ -0,0 +1,17 @@ +/** + * Functions for the unit type. + */ + +use cmp::{Eq, Ord}; + +impl () : Eq { + pure fn eq(&&_other: ()) -> bool { true } +} + +impl () : Ord { + pure fn lt(&&_other: ()) -> bool { false } + pure fn le(&&_other: ()) -> bool { true } + pure fn ge(&&_other: ()) -> bool { true } + pure fn gt(&&_other: ()) -> bool { false } +} +