@@ -17,7 +17,7 @@ use std::io::{Cursor, Seek};
1717use varint_rs:: { VarintReader , VarintWriter } ;
1818
1919/// Points to a block on file
20- #[ derive( Copy , Clone , Debug , Default , Eq ) ]
20+ #[ derive( Copy , Clone , Debug , Default ) ]
2121pub struct BlockHandle {
2222 /// Position of block in file
2323 offset : BlockOffset ,
@@ -43,24 +43,6 @@ impl BlockHandle {
4343 }
4444}
4545
46- impl PartialEq for BlockHandle {
47- fn eq ( & self , other : & Self ) -> bool {
48- self . offset == other. offset
49- }
50- }
51-
52- impl Ord for BlockHandle {
53- fn cmp ( & self , other : & Self ) -> std:: cmp:: Ordering {
54- self . offset . cmp ( & other. offset )
55- }
56- }
57-
58- impl PartialOrd for BlockHandle {
59- fn partial_cmp ( & self , other : & Self ) -> Option < std:: cmp:: Ordering > {
60- Some ( self . cmp ( other) )
61- }
62- }
63-
6446impl Encode for BlockHandle {
6547 fn encode_into < W : std:: io:: Write > ( & self , writer : & mut W ) -> Result < ( ) , crate :: Error > {
6648 writer. write_u64_varint ( * self . offset ) ?;
@@ -85,7 +67,7 @@ impl Decode for BlockHandle {
8567}
8668
8769/// Points to a block on file
88- #[ derive( Clone , Debug , Eq ) ]
70+ #[ derive( Clone , Debug ) ]
8971pub struct KeyedBlockHandle {
9072 /// Key of last item in block
9173 end_key : UserKey ,
@@ -138,24 +120,13 @@ impl KeyedBlockHandle {
138120 }
139121}
140122
123+ #[ cfg( test) ]
141124impl PartialEq for KeyedBlockHandle {
142125 fn eq ( & self , other : & Self ) -> bool {
143126 self . offset ( ) == other. offset ( )
144127 }
145128}
146129
147- impl Ord for KeyedBlockHandle {
148- fn cmp ( & self , other : & Self ) -> std:: cmp:: Ordering {
149- self . offset ( ) . cmp ( & other. offset ( ) )
150- }
151- }
152-
153- impl PartialOrd for KeyedBlockHandle {
154- fn partial_cmp ( & self , other : & Self ) -> Option < std:: cmp:: Ordering > {
155- Some ( self . cmp ( other) )
156- }
157- }
158-
159130impl Encodable < BlockOffset > for KeyedBlockHandle {
160131 fn encode_full_into < W : std:: io:: Write > (
161132 & self ,
0 commit comments