Skip to content

Commit

Permalink
some clippy warnings fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
4tm4j33tk4ur committed Oct 18, 2016
1 parent 97fc370 commit 2314ab8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//! macros that are used to describe benchmarker functions and
//! the benchmark runner.
//!
//! WARNING: There's no proper black_box yet in this stable port of the benchmark runner,
//! WARNING: There's no proper `black_box` yet in this stable port of the benchmark runner,
//! only a workaround implementation. It may not work correctly and may have too
//! large overhead.
//!
Expand Down Expand Up @@ -128,7 +128,7 @@ pub enum TestFn {
impl TestFn {
fn padding(&self) -> NamePadding {
match *self {
StaticBenchFn(..) => PadOnRight,
StaticBenchFn(..) |
DynBenchFn(..) => PadOnRight,
}
}
Expand Down Expand Up @@ -383,7 +383,7 @@ impl<T: Write> ConsoleTestState<T> {
self.ignored,
self.measured);
try!(self.write_plain(&s));
return Ok(success);
Ok(success)
}
}

Expand Down Expand Up @@ -463,7 +463,7 @@ pub fn run_tests_console(opts: &TestOpts, tests: Vec<TestDescAndFn>) -> io::Resu
st.max_name_len = n.len();
}
try!(run_tests(opts, tests, |x| callback(&x, &mut st)));
return st.write_run_finish();
st.write_run_finish()
}

#[test]
Expand Down Expand Up @@ -595,7 +595,7 @@ fn run_test(_opts: &TestOpts,
return;
}
StaticBenchFn(benchfn) => {
let bs = ::bench::benchmark(|harness| (benchfn.clone())(harness));
let bs = ::bench::benchmark(|harness| benchfn(harness));
monitor_ch.send((desc, TrBench(bs), Vec::new())).unwrap();
return;
}
Expand Down Expand Up @@ -736,7 +736,7 @@ impl Bencher {
return summ5;
}

total_run = total_run + loop_run;
total_run += loop_run;
// Longest we ever run for is 3s.
if total_run > Duration::from_secs(3) {
return summ5;
Expand Down
2 changes: 1 addition & 1 deletion stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl Stats for [f64] {
let mut v: f64 = 0.0;
for s in self {
let x = *s - mean;
v = v + x * x;
v += x * x;
}
// NB: this is _supposed to be_ len-1, not len. If you
// change it back to len, you will be calculating a
Expand Down

0 comments on commit 2314ab8

Please sign in to comment.