diff options
| author | OGINO Masanori <masanori.ogino@gmail.com> | 2013-08-08 10:03:34 +0900 |
|---|---|---|
| committer | OGINO Masanori <masanori.ogino@gmail.com> | 2013-08-09 14:28:14 +0900 |
| commit | b4d6ae5bb8959affdb91a6b6791e725f97787344 (patch) | |
| tree | dc260f75791e1d195a457ca5acb5d9a1df9a7ea5 /src/libstd/bool.rs | |
| parent | 7a1b61d6317c27b735e5471d3d704584bea4c925 (diff) | |
Remove redundant Ord method impls.
Basically, generic containers should not use the default methods since a type of elements may not guarantees total order. str could use them since u8's Ord guarantees total order. Floating point numbers are also broken with the default methods because of NaN. Thanks for @thestinger. Timespec also guarantees total order AIUI. I'm unsure whether extra::semver::Identifier does so I left it alone. Proof needed. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
Diffstat (limited to 'src/libstd/bool.rs')
| -rw-r--r-- | src/libstd/bool.rs | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/libstd/bool.rs b/src/libstd/bool.rs index eeaea6a2cff..598e8080618 100644 --- a/src/libstd/bool.rs +++ b/src/libstd/bool.rs @@ -284,12 +284,6 @@ impl Not<bool> for bool { impl Ord for bool { #[inline] fn lt(&self, other: &bool) -> bool { to_bit(*self) < to_bit(*other) } - #[inline] - fn le(&self, other: &bool) -> bool { to_bit(*self) <= to_bit(*other) } - #[inline] - fn gt(&self, other: &bool) -> bool { to_bit(*self) > to_bit(*other) } - #[inline] - fn ge(&self, other: &bool) -> bool { to_bit(*self) >= to_bit(*other) } } #[cfg(not(test))] |
