File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed
Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -52,9 +52,7 @@ impl<T: Tag> Hash<T> {
5252
5353impl < T : Tag > Copy for Hash < T > { }
5454impl < T : Tag > Clone for Hash < T > {
55- fn clone ( & self ) -> Self {
56- Hash ( self . 0 , self . 1 )
57- }
55+ fn clone ( & self ) -> Self { * self }
5856}
5957impl < T : Tag > PartialEq for Hash < T > {
6058 fn eq ( & self , other : & Hash < T > ) -> bool {
@@ -69,7 +67,7 @@ impl<T: Tag> Default for Hash<T> {
6967}
7068impl < T : Tag > PartialOrd for Hash < T > {
7169 fn partial_cmp ( & self , other : & Hash < T > ) -> Option < cmp:: Ordering > {
72- Some ( cmp:: Ord :: cmp ( self , other) )
70+ Some ( self . cmp ( other) )
7371 }
7472}
7573impl < T : Tag > Ord for Hash < T > {
Original file line number Diff line number Diff line change @@ -101,11 +101,7 @@ impl Hash {
101101impl Copy for Hash { }
102102
103103impl Clone for Hash {
104- fn clone ( & self ) -> Hash {
105- let mut ret = [ 0 ; 64 ] ;
106- ret. copy_from_slice ( & self . 0 ) ;
107- Hash ( ret)
108- }
104+ fn clone ( & self ) -> Self { * self }
109105}
110106
111107impl PartialEq for Hash {
@@ -124,7 +120,7 @@ impl Default for Hash {
124120
125121impl PartialOrd for Hash {
126122 fn partial_cmp ( & self , other : & Hash ) -> Option < cmp:: Ordering > {
127- self . 0 . partial_cmp ( & other. 0 )
123+ Some ( self . cmp ( other) )
128124 }
129125}
130126
You can’t perform that action at this time.
0 commit comments