From 140e2d3a092ebbeea5e110222bea3b37bc49abb8 Mon Sep 17 00:00:00 2001 From: Lee Jeffery Date: Sun, 20 Sep 2015 11:35:08 +0100 Subject: Miscellaneous cleanup for old issues. --- src/libstd/sys/common/wtf8.rs | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'src/libstd/sys') diff --git a/src/libstd/sys/common/wtf8.rs b/src/libstd/sys/common/wtf8.rs index 633e7d78a9a..10f77d0207c 100644 --- a/src/libstd/sys/common/wtf8.rs +++ b/src/libstd/sys/common/wtf8.rs @@ -31,7 +31,6 @@ use core::str::next_code_point; use ascii::*; use borrow::Cow; use char; -use cmp; use fmt; use hash::{Hash, Hasher}; use iter::FromIterator; @@ -375,6 +374,7 @@ impl Extend for Wtf8Buf { /// /// Similar to `&str`, but can additionally contain surrogate code points /// if they’re not in a surrogate pair. +#[derive(Eq, Ord, PartialEq, PartialOrd)] pub struct Wtf8 { bytes: [u8] } @@ -383,36 +383,6 @@ impl AsInner<[u8]> for Wtf8 { fn as_inner(&self) -> &[u8] { &self.bytes } } -// FIXME: https://github.com/rust-lang/rust/issues/18805 -impl PartialEq for Wtf8 { - fn eq(&self, other: &Wtf8) -> bool { self.bytes.eq(&other.bytes) } -} - -// FIXME: https://github.com/rust-lang/rust/issues/18805 -impl Eq for Wtf8 {} - -// FIXME: https://github.com/rust-lang/rust/issues/18738 -impl PartialOrd for Wtf8 { - #[inline] - fn partial_cmp(&self, other: &Wtf8) -> Option { - self.bytes.partial_cmp(&other.bytes) - } - #[inline] - fn lt(&self, other: &Wtf8) -> bool { self.bytes.lt(&other.bytes) } - #[inline] - fn le(&self, other: &Wtf8) -> bool { self.bytes.le(&other.bytes) } - #[inline] - fn gt(&self, other: &Wtf8) -> bool { self.bytes.gt(&other.bytes) } - #[inline] - fn ge(&self, other: &Wtf8) -> bool { self.bytes.ge(&other.bytes) } -} - -// FIXME: https://github.com/rust-lang/rust/issues/18738 -impl Ord for Wtf8 { - #[inline] - fn cmp(&self, other: &Wtf8) -> cmp::Ordering { self.bytes.cmp(&other.bytes) } -} - /// Format the slice with double quotes, /// and surrogates as `\u` followed by four hexadecimal digits. /// Example: `"a\u{D800}"` for a slice with code points [U+0061, U+D800] -- cgit 1.4.1-3-g733a5