diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-03-21 21:34:30 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-03-22 10:29:17 -0700 |
| commit | c1084091d4e5472fac7e158b11120bad6ff210ff (patch) | |
| tree | 745a42f03c8c88670da739313cd8050a5f1d8b37 /src/libstd/cmp.rs | |
| parent | be9bddd46377bc982b73acf15a720365a54197a7 (diff) | |
| download | rust-c1084091d4e5472fac7e158b11120bad6ff210ff.tar.gz rust-c1084091d4e5472fac7e158b11120bad6ff210ff.zip | |
libstd: Remove all uses of `pure` from libstd. rs=depure
Diffstat (limited to 'src/libstd/cmp.rs')
| -rw-r--r-- | src/libstd/cmp.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libstd/cmp.rs b/src/libstd/cmp.rs index b6362f83f44..6fd77de0342 100644 --- a/src/libstd/cmp.rs +++ b/src/libstd/cmp.rs @@ -17,36 +17,36 @@ use core::float; pub const FUZZY_EPSILON: float = 1.0e-6; pub trait FuzzyEq<Eps> { - pure fn fuzzy_eq(&self, other: &Self) -> bool; - pure fn fuzzy_eq_eps(&self, other: &Self, epsilon: &Eps) -> bool; + fn fuzzy_eq(&self, other: &Self) -> bool; + fn fuzzy_eq_eps(&self, other: &Self, epsilon: &Eps) -> bool; } impl FuzzyEq<float> for float { - pure fn fuzzy_eq(&self, other: &float) -> bool { + fn fuzzy_eq(&self, other: &float) -> bool { self.fuzzy_eq_eps(other, &FUZZY_EPSILON) } - pure fn fuzzy_eq_eps(&self, other: &float, epsilon: &float) -> bool { + fn fuzzy_eq_eps(&self, other: &float, epsilon: &float) -> bool { float::abs(*self - *other) < *epsilon } } impl FuzzyEq<f32> for f32 { - pure fn fuzzy_eq(&self, other: &f32) -> bool { + fn fuzzy_eq(&self, other: &f32) -> bool { self.fuzzy_eq_eps(other, &(FUZZY_EPSILON as f32)) } - pure fn fuzzy_eq_eps(&self, other: &f32, epsilon: &f32) -> bool { + fn fuzzy_eq_eps(&self, other: &f32, epsilon: &f32) -> bool { f32::abs(*self - *other) < *epsilon } } impl FuzzyEq<f64> for f64 { - pure fn fuzzy_eq(&self, other: &f64) -> bool { + fn fuzzy_eq(&self, other: &f64) -> bool { self.fuzzy_eq_eps(other, &(FUZZY_EPSILON as f64)) } - pure fn fuzzy_eq_eps(&self, other: &f64, epsilon: &f64) -> bool { + fn fuzzy_eq_eps(&self, other: &f64, epsilon: &f64) -> bool { f64::abs(*self - *other) < *epsilon } } @@ -71,11 +71,11 @@ mod test_complex{ struct Complex { r: float, i: float } impl FuzzyEq<float> for Complex { - pure fn fuzzy_eq(&self, other: &Complex) -> bool { + fn fuzzy_eq(&self, other: &Complex) -> bool { self.fuzzy_eq_eps(other, &FUZZY_EPSILON) } - pure fn fuzzy_eq_eps(&self, other: &Complex, + fn fuzzy_eq_eps(&self, other: &Complex, epsilon: &float) -> bool { self.r.fuzzy_eq_eps(&other.r, epsilon) && self.i.fuzzy_eq_eps(&other.i, epsilon) |
