diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2014-03-08 01:10:32 -0500 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2014-03-14 15:26:05 -0400 |
| commit | 4e1c2158f29fbb6c2bdb4d50f1fdc6a30685bc3c (patch) | |
| tree | a79d99849861d34fc0c61c7a0b8886e8c94f171b /src/libtest | |
| parent | 3fbee34a89c478f959046bf4b4e12a70e937c374 (diff) | |
| download | rust-4e1c2158f29fbb6c2bdb4d50f1fdc6a30685bc3c.tar.gz rust-4e1c2158f29fbb6c2bdb4d50f1fdc6a30685bc3c.zip | |
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
Diffstat (limited to 'src/libtest')
| -rw-r--r-- | src/libtest/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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 |
