Skip to content

Commit 8befbff

Browse files
author
Jorge Aparicio
committed
fix(lib): fix fallout of numeric reform
See rust-lang/rust#18827
1 parent 0f6808e commit 8befbff

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

src/format.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::num;
1+
use std::num::Float;
22

33
pub fn change(pct: f64, signed: bool) -> String {
44
if signed {
@@ -27,11 +27,11 @@ fn signed_short(n: f64) -> String {
2727
pub fn time(ns: f64) -> String {
2828
if ns < 1.0 {
2929
format!("{:>6} ps", short(ns * 1e3))
30-
} else if ns < num::pow(10.0, 3) {
30+
} else if ns < 10.0.powi(3) {
3131
format!("{:>6} ns", short(ns))
32-
} else if ns < num::pow(10.0, 6) {
32+
} else if ns < 10.0.powi(6) {
3333
format!("{:>6} us", short(ns / 1e3))
34-
} else if ns < num::pow(10.0, 9) {
34+
} else if ns < 10.0.powi(9) {
3535
format!("{:>6} ms", short(ns / 1e6))
3636
} else {
3737
format!("{:>6} s", short(ns / 1e9))

src/plot/both.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use simplot::key::{Inside, Left, LeftJustified, Outside, Right, SampleText, Top}
55
use simplot::{Figure, Solid};
66
use stats::ConfidenceInterval;
77
use std::iter::Repeat;
8+
use std::num::Float;
89
use std::str;
910
use test::stats::Stats;
1011

src/plot/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use stats::outliers::{Outliers, LowMild, LowSevere, HighMild, HighSevere};
1010
use stats::regression::Slope;
1111
use std::io::fs::PathExtensions;
1212
use std::iter::{Repeat, mod};
13+
use std::num::Float;
1314
use std::str;
1415

1516
use estimate::{Distributions, Estimate, Estimates, Mean, Median, mod};

src/routine.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::iter::{AdditiveIterator, mod};
2+
use std::num::Float;
23
use time;
34

45
use format;

0 commit comments

Comments
 (0)