@@ -31,7 +31,6 @@ use core::str::next_code_point;
31
31
use ascii:: * ;
32
32
use borrow:: Cow ;
33
33
use char;
34
- use cmp;
35
34
use fmt;
36
35
use hash:: { Hash , Hasher } ;
37
36
use iter:: FromIterator ;
@@ -375,6 +374,7 @@ impl Extend<CodePoint> for Wtf8Buf {
375
374
///
376
375
/// Similar to `&str`, but can additionally contain surrogate code points
377
376
/// if they’re not in a surrogate pair.
377
+ #[ derive( Eq , Ord , PartialEq , PartialOrd ) ]
378
378
pub struct Wtf8 {
379
379
bytes : [ u8 ]
380
380
}
@@ -383,36 +383,6 @@ impl AsInner<[u8]> for Wtf8 {
383
383
fn as_inner ( & self ) -> & [ u8 ] { & self . bytes }
384
384
}
385
385
386
- // FIXME: https://github.com/rust-lang/rust/issues/18805
387
- impl PartialEq for Wtf8 {
388
- fn eq ( & self , other : & Wtf8 ) -> bool { self . bytes . eq ( & other. bytes ) }
389
- }
390
-
391
- // FIXME: https://github.com/rust-lang/rust/issues/18805
392
- impl Eq for Wtf8 { }
393
-
394
- // FIXME: https://github.com/rust-lang/rust/issues/18738
395
- impl PartialOrd for Wtf8 {
396
- #[ inline]
397
- fn partial_cmp ( & self , other : & Wtf8 ) -> Option < cmp:: Ordering > {
398
- self . bytes . partial_cmp ( & other. bytes )
399
- }
400
- #[ inline]
401
- fn lt ( & self , other : & Wtf8 ) -> bool { self . bytes . lt ( & other. bytes ) }
402
- #[ inline]
403
- fn le ( & self , other : & Wtf8 ) -> bool { self . bytes . le ( & other. bytes ) }
404
- #[ inline]
405
- fn gt ( & self , other : & Wtf8 ) -> bool { self . bytes . gt ( & other. bytes ) }
406
- #[ inline]
407
- fn ge ( & self , other : & Wtf8 ) -> bool { self . bytes . ge ( & other. bytes ) }
408
- }
409
-
410
- // FIXME: https://github.com/rust-lang/rust/issues/18738
411
- impl Ord for Wtf8 {
412
- #[ inline]
413
- fn cmp ( & self , other : & Wtf8 ) -> cmp:: Ordering { self . bytes . cmp ( & other. bytes ) }
414
- }
415
-
416
386
/// Format the slice with double quotes,
417
387
/// and surrogates as `\u` followed by four hexadecimal digits.
418
388
/// Example: `"a\u{D800}"` for a slice with code points [U+0061, U+D800]
0 commit comments