about summary refs log tree commit diff
path: root/src/libcore/num
diff options
context:
space:
mode:
authorLinus Färnstrand <faern@faern.net>2020-04-17 01:38:42 +0200
committerLinus Färnstrand <faern@faern.net>2020-04-20 23:38:06 +0200
commit6850e4a1ae43a7e6740d7b77ed8005dbf58b33e0 (patch)
tree7c7990f7c4746d7b54c432e62d41e392e1c483e2 /src/libcore/num
parent4ddf66187aeca3ad1d44e239c794ecf4be95c5bf (diff)
downloadrust-6850e4a1ae43a7e6740d7b77ed8005dbf58b33e0.tar.gz
rust-6850e4a1ae43a7e6740d7b77ed8005dbf58b33e0.zip
Use assoc float consts instead of module level
Diffstat (limited to 'src/libcore/num')
-rw-r--r--src/libcore/num/f32.rs4
-rw-r--r--src/libcore/num/f64.rs4
-rw-r--r--src/libcore/num/flt2dec/decoder.rs1
3 files changed, 4 insertions, 5 deletions
diff --git a/src/libcore/num/f32.rs b/src/libcore/num/f32.rs
index 6be108f280e..32f49563289 100644
--- a/src/libcore/num/f32.rs
+++ b/src/libcore/num/f32.rs
@@ -265,7 +265,7 @@ impl f32 {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
     pub fn is_infinite(self) -> bool {
-        self.abs_private() == INFINITY
+        self.abs_private() == Self::INFINITY
     }
 
     /// Returns `true` if this number is neither infinite nor `NaN`.
@@ -287,7 +287,7 @@ impl f32 {
     pub fn is_finite(self) -> bool {
         // There's no need to handle NaN separately: if self is NaN,
         // the comparison is not true, exactly as desired.
-        self.abs_private() < INFINITY
+        self.abs_private() < Self::INFINITY
     }
 
     /// Returns `true` if the number is neither zero, infinite,
diff --git a/src/libcore/num/f64.rs b/src/libcore/num/f64.rs
index da22ba8d3c9..b38fd804ee8 100644
--- a/src/libcore/num/f64.rs
+++ b/src/libcore/num/f64.rs
@@ -264,7 +264,7 @@ impl f64 {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
     pub fn is_infinite(self) -> bool {
-        self.abs_private() == INFINITY
+        self.abs_private() == Self::INFINITY
     }
 
     /// Returns `true` if this number is neither infinite nor `NaN`.
@@ -286,7 +286,7 @@ impl f64 {
     pub fn is_finite(self) -> bool {
         // There's no need to handle NaN separately: if self is NaN,
         // the comparison is not true, exactly as desired.
-        self.abs_private() < INFINITY
+        self.abs_private() < Self::INFINITY
     }
 
     /// Returns `true` if the number is neither zero, infinite,
diff --git a/src/libcore/num/flt2dec/decoder.rs b/src/libcore/num/flt2dec/decoder.rs
index 2b74effbe2e..c43536c6fcc 100644
--- a/src/libcore/num/flt2dec/decoder.rs
+++ b/src/libcore/num/flt2dec/decoder.rs
@@ -2,7 +2,6 @@
 
 use crate::num::dec2flt::rawfp::RawFloat;
 use crate::num::FpCategory;
-use crate::{f32, f64};
 
 /// Decoded unsigned finite value, such that:
 ///