diff options
| author | Kevin Cantu <me@kevincantu.org> | 2012-08-30 14:44:28 -0700 |
|---|---|---|
| committer | Kevin Cantu <me@kevincantu.org> | 2012-08-31 12:55:39 -0700 |
| commit | 2580040995ec0db96aa180170195c1ae318fc9ed (patch) | |
| tree | 8258d3b83529e30d01723370a1fd25084b9150c3 /src/libstd | |
| parent | 340a21929024efedec5dfa8d4c6a14df41640f78 (diff) | |
Remove deprecated modes from FuzzyEq in cmp.rs
This commit may require changes to the following Servo files: * rust-geom/matrix.rs * servo/platform/osmain.rs * rust-layers/layers.rs * rust-geom/matrix.rs
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/cmp.rs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/libstd/cmp.rs b/src/libstd/cmp.rs index fb42c690246..6484bf298d2 100644 --- a/src/libstd/cmp.rs +++ b/src/libstd/cmp.rs @@ -1,34 +1,36 @@ #[deny(non_camel_case_types)]; +#[forbid(deprecated_mode)]; +#[forbid(deprecated_pattern)]; /// Additional general-purpose comparison functionality. const fuzzy_epsilon: float = 1.0e-6; trait FuzzyEq { - pure fn fuzzy_eq(&&other: self) -> bool; + pure fn fuzzy_eq(other: &self) -> bool; } impl float: FuzzyEq { - pure fn fuzzy_eq(&&other: float) -> bool { - return float::abs(self - other) < fuzzy_epsilon; + pure fn fuzzy_eq(other: &float) -> bool { + return float::abs(self - *other) < fuzzy_epsilon; } } impl f32: FuzzyEq { - pure fn fuzzy_eq(&&other: f32) -> bool { - return f32::abs(self - other) < (fuzzy_epsilon as f32); + pure fn fuzzy_eq(other: &f32) -> bool { + return f32::abs(self - *other) < (fuzzy_epsilon as f32); } } impl f64: FuzzyEq { - pure fn fuzzy_eq(&&other: f64) -> bool { - return f64::abs(self - other) < (fuzzy_epsilon as f64); + pure fn fuzzy_eq(other: &f64) -> bool { + return f64::abs(self - *other) < (fuzzy_epsilon as f64); } } #[test] fn test_fuzzy_equals() { - assert ((1.0).fuzzy_eq(1.0)); - assert ((1.0f32).fuzzy_eq(1.0f32)); - assert ((1.0f64).fuzzy_eq(1.0f64)); + assert ((&1.0).fuzzy_eq(&1.0)); + assert ((&1.0f32).fuzzy_eq(&1.0f32)); + assert ((&1.0f64).fuzzy_eq(&1.0f64)); } |
