Skip to content

Commit e488f9e

Browse files
Merge pull request #2598 from quickwit-oss/1686a/agg-key-eq
fix invalid impl of Eq on Key
2 parents d5d2d41 + 9426d5b commit e488f9e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/aggregation/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,12 @@ impl PartialEq for Key {
366366
fn eq(&self, other: &Self) -> bool {
367367
match (self, other) {
368368
(Self::Str(l), Self::Str(r)) => l == r,
369-
(Self::F64(l), Self::F64(r)) => l == r,
370-
_ => false,
369+
(Self::F64(l), Self::F64(r)) => l.to_bits() == r.to_bits(),
370+
(Self::I64(l), Self::I64(r)) => l == r,
371+
(Self::U64(l), Self::U64(r)) => l == r,
372+
// we list all variant of left operand to make sure this gets updated when we add
373+
// variants to the enum
374+
(Self::Str(_) | Self::F64(_) | Self::I64(_) | Self::U64(_), _) => false,
371375
}
372376
}
373377
}

0 commit comments

Comments
 (0)