Make sure Eq and Hash impls of Scalar match

This commit is contained in:
Hanno Braun 2025-03-24 20:38:14 +01:00
parent 2ef096b2fb
commit d9ce7f436c

View File

@ -159,7 +159,9 @@ impl Scalar {
impl PartialEq for Scalar {
fn eq(&self, other: &Self) -> bool {
self.value == other.value
// Using `R64` here to make sure that this matches the `Eq`/`PartialEq`
// implementation, as required by `Hash`.
R64::from_inner(self.value).eq(&R64::from_inner(other.value))
}
}