]> git.lizzy.rs Git - rust.git/blob - src/libstd/nil.rs
Remove redundant Ord method impls.
[rust.git] / src / libstd / nil.rs
1 // Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 /*!
12
13 Functions for the unit type.
14
15 */
16
17 #[cfg(not(test))]
18 use prelude::*;
19 #[cfg(not(test))]
20 use num::Zero;
21
22
23
24 #[cfg(not(test))]
25 impl Eq for () {
26     #[inline]
27     fn eq(&self, _other: &()) -> bool { true }
28     #[inline]
29     fn ne(&self, _other: &()) -> bool { false }
30 }
31
32 #[cfg(not(test))]
33 impl Ord for () {
34     #[inline]
35     fn lt(&self, _other: &()) -> bool { false }
36 }
37
38 #[cfg(not(test))]
39 impl TotalOrd for () {
40     #[inline]
41     fn cmp(&self, _other: &()) -> Ordering { Equal }
42 }
43
44 #[cfg(not(test))]
45 impl TotalEq for () {
46     #[inline]
47     fn equals(&self, _other: &()) -> bool { true }
48 }
49
50 #[cfg(not(test))]
51 impl Zero for () {
52     fn zero() -> () { () }
53     fn is_zero(&self) -> bool { true }
54 }
55