Skip to content

Commit 9ae99a1

Browse files
committed
refactor
1 parent 735d0d3 commit 9ae99a1

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

src/merge.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ type IterItem = crate::Result<InternalValue>;
99

1010
pub type BoxedIterator<'a> = Box<dyn DoubleEndedIterator<Item = IterItem> + Send + 'a>;
1111

12-
#[derive(Eq)]
1312
struct HeapItem(usize, InternalValue);
1413

14+
impl Eq for HeapItem {}
15+
1516
impl PartialEq for HeapItem {
1617
fn eq(&self, other: &Self) -> bool {
1718
self.1.key == other.1.key

src/table/id.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
}

src/value.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub type UserValue = Slice;
2222
pub type SeqNo = u64;
2323

2424
/// Internal representation of KV pairs
25-
#[derive(Clone, Eq)]
25+
#[derive(Clone)]
2626
pub 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))]
9698
impl PartialEq for InternalValue {
9799
fn eq(&self, other: &Self) -> bool {
98100
self.key == other.key

0 commit comments

Comments
 (0)