File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed
Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,10 @@ type IterItem = crate::Result<InternalValue>;
99
1010pub type BoxedIterator < ' a > = Box < dyn DoubleEndedIterator < Item = IterItem > + Send + ' a > ;
1111
12- #[ derive( Eq ) ]
1312struct HeapItem ( usize , InternalValue ) ;
1413
14+ impl Eq for HeapItem { }
15+
1516impl PartialEq for HeapItem {
1617 fn eq ( & self , other : & Self ) -> bool {
1718 self . 1 . key == other. 1 . key
Original file line number Diff line number Diff line change @@ -26,3 +26,19 @@ impl From<(TreeId, TableId)> for GlobalTableId {
2626 Self ( tid, sid)
2727 }
2828}
29+
30+ #[ cfg( test) ]
31+ mod tests {
32+ use super :: * ;
33+ use test_log:: test;
34+
35+ #[ test]
36+ fn global_table_id_accessors ( ) {
37+ let tree_id = 42 ;
38+ let table_id: TableId = 7 ;
39+ let global_table_id = GlobalTableId :: from ( ( tree_id, table_id) ) ;
40+
41+ assert_eq ! ( global_table_id. tree_id( ) , 42 ) ;
42+ assert_eq ! ( global_table_id. table_id( ) , 7 ) ;
43+ }
44+ }
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ pub type UserValue = Slice;
2222pub type SeqNo = u64 ;
2323
2424/// Internal representation of KV pairs
25- #[ derive( Clone , Eq ) ]
25+ #[ derive( Clone ) ]
2626pub struct InternalValue {
2727 /// Internal key
2828 pub key : InternalKey ,
@@ -93,6 +93,8 @@ impl InternalValue {
9393 }
9494}
9595
96+ #[ cfg( test) ]
97+ #[ cfg_attr( coverage_nightly, coverage( off) ) ]
9698impl PartialEq for InternalValue {
9799 fn eq ( & self , other : & Self ) -> bool {
98100 self . key == other. key
You can’t perform that action at this time.
0 commit comments