Skip to content

Commit 09ad71c

Browse files
committed
Fix equality comparison between Row::Ptr and Row::Ref
1 parent 29a0df4 commit 09ad71c

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

crates/execution/src/lib.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,25 @@ pub trait DeltaStore {
115115
}
116116
}
117117

118-
#[derive(Clone, PartialEq, Eq)]
118+
#[derive(Clone)]
119119
pub enum Row<'a> {
120120
Ptr(RowRef<'a>),
121121
Ref(&'a ProductValue),
122122
}
123123

124+
impl PartialEq for Row<'_> {
125+
fn eq(&self, other: &Self) -> bool {
126+
match (self, other) {
127+
(Self::Ptr(x), Self::Ptr(y)) => x == y,
128+
(Self::Ref(x), Self::Ref(y)) => x == y,
129+
(Self::Ptr(x), Self::Ref(y)) => x == *y,
130+
(Self::Ref(x), Self::Ptr(y)) => y == *x,
131+
}
132+
}
133+
}
134+
135+
impl Eq for Row<'_> {}
136+
124137
impl Hash for Row<'_> {
125138
fn hash<H: Hasher>(&self, state: &mut H) {
126139
match self {

0 commit comments

Comments
 (0)