Skip to content

Commit 9046e3f

Browse files
author
Timothée Haudebourg
committed
Avoid Self:: for older Rust versions.
Also fix a clippy warning.
1 parent c3ac6c0 commit 9046e3f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/number.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ enum N {
3535
impl PartialEq for N {
3636
fn eq(&self, other: &Self) -> bool {
3737
match (self, other) {
38-
(Self::PosInt(a), Self::PosInt(b)) => a == b,
39-
(Self::NegInt(a), Self::NegInt(b)) => a == b,
40-
(Self::Float(a), Self::Float(b)) => a == b,
38+
(N::PosInt(a), N::PosInt(b)) => a == b,
39+
(N::NegInt(a), N::NegInt(b)) => a == b,
40+
(N::Float(a), N::Float(b)) => a == b,
4141
_ => false,
4242
}
4343
}
@@ -51,11 +51,11 @@ impl Eq for N {}
5151
impl core::hash::Hash for N {
5252
fn hash<H: core::hash::Hasher>(&self, h: &mut H) {
5353
match self {
54-
Self::PosInt(i) => i.hash(h),
55-
Self::NegInt(i) => i.hash(h),
56-
Self::Float(f) => {
54+
N::PosInt(i) => i.hash(h),
55+
N::NegInt(i) => i.hash(h),
56+
N::Float(f) => {
5757
// Using `f64::to_bits` here is fine since any float values are always finite.
58-
f.to_bits().hash(h)
58+
f.to_bits().hash(h);
5959
}
6060
}
6161
}

0 commit comments

Comments
 (0)