From 4e1c2158f29fbb6c2bdb4d50f1fdc6a30685bc3c Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sat, 8 Mar 2014 01:10:32 -0500 Subject: cmp: switch `min` and `max` to `TotalOrd` The `Float` trait provides correct `min` and `max` methods on floating point types, providing a consistent result regardless of the order the parameters are passed. These generic functions do not take the necessary performance hit to correctly support a partial order, so the true requirement should be given as a type bound. Closes #12712 --- src/libtest/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libtest') diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 9ebd7d72c91..0f9ae1af096 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -1069,7 +1069,7 @@ impl MetricMap { if delta.abs() <= noise { LikelyNoise } else { - let pct = delta.abs() / cmp::max(vold.value, f64::EPSILON) * 100.0; + let pct = delta.abs() / vold.value.max(f64::EPSILON) * 100.0; if vold.noise < 0.0 { // When 'noise' is negative, it means we want // to see deltas that go up over time, and can -- cgit 1.4.1-3-g733a5