From 04868a23099fa52c3c82b3c50e6cc37b53c1906c Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Thu, 4 Jul 2019 05:47:32 -0400 Subject: [PATCH] Be explicit about expected type --- implementations/rust/src/value/value.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/implementations/rust/src/value/value.rs b/implementations/rust/src/value/value.rs index 9a3d33f..4b6e94b 100644 --- a/implementations/rust/src/value/value.rs +++ b/implementations/rust/src/value/value.rs @@ -49,8 +49,8 @@ impl PartialEq for Float { impl Ord for Float { fn cmp(&self, other: &Self) -> Ordering { - let mut a = self.0.to_bits(); - let mut b = other.0.to_bits(); + let mut a: u32 = self.0.to_bits(); + let mut b: u32 = other.0.to_bits(); if a & 0x80000000 != 0 { a ^= 0x7fffffff; } if b & 0x80000000 != 0 { b ^= 0x7fffffff; } (a as i32).cmp(&(b as i32)) @@ -91,8 +91,8 @@ impl PartialEq for Double { impl Ord for Double { fn cmp(&self, other: &Self) -> Ordering { - let mut a = self.0.to_bits(); - let mut b = other.0.to_bits(); + let mut a: u64 = self.0.to_bits(); + let mut b: u64 = other.0.to_bits(); if a & 0x8000000000000000 != 0 { a ^= 0x7fffffffffffffff; } if b & 0x8000000000000000 != 0 { b ^= 0x7fffffffffffffff; } (a as i64).cmp(&(b as i64))