libcore: Add missing unit.rs

This commit is contained in:
Patrick Walton 2012-08-30 10:14:54 -07:00
parent a1c11cab2d
commit 45e46f5fc0

17
src/libcore/unit.rs Normal file
View File

@ -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 }
}