Skip to content

Commit

Permalink
Rollup merge of #77389 - jyn514:THE-PAPERCLIP-COMETH, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Fix some clippy lints

Found while working on #77351;
these are just the ones that could be fixed automatically.
  • Loading branch information
JohnTitor authored Oct 1, 2020
2 parents 2e749ab + 8164218 commit fbb3dd4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion library/test/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ where
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 library/test/src/formatters/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl<T: Write> PrettyFormatter<T> {
stdouts.push_str(&format!("---- {} stdout ----\n", f.name));
let output = String::from_utf8_lossy(stdout);
stdouts.push_str(&output);
stdouts.push_str("\n");
stdouts.push('\n');
}
}
if !stdouts.is_empty() {
Expand Down
4 changes: 2 additions & 2 deletions library/test/src/formatters/terse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl<T: Write> TerseFormatter<T> {
stdouts.push_str(&format!("---- {} stdout ----\n", f.name));
let output = String::from_utf8_lossy(stdout);
stdouts.push_str(&output);
stdouts.push_str("\n");
stdouts.push('\n');
}
}
if !stdouts.is_empty() {
Expand All @@ -140,7 +140,7 @@ impl<T: Write> TerseFormatter<T> {
fail_out.push_str(&format!("---- {} stdout ----\n", f.name));
let output = String::from_utf8_lossy(stdout);
fail_out.push_str(&output);
fail_out.push_str("\n");
fail_out.push('\n');
}
}
if !fail_out.is_empty() {
Expand Down
8 changes: 3 additions & 5 deletions library/test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,9 @@ where
let event = TestEvent::TeFiltered(filtered_descs);
notify_about_test_event(event)?;

let (filtered_tests, filtered_benchs): (Vec<_>, _) =
filtered_tests.into_iter().partition(|e| match e.testfn {
StaticTestFn(_) | DynTestFn(_) => true,
_ => false,
});
let (filtered_tests, filtered_benchs): (Vec<_>, _) = filtered_tests
.into_iter()
.partition(|e| matches!(e.testfn, StaticTestFn(_) | DynTestFn(_)));

let concurrency = opts.test_threads.unwrap_or_else(get_concurrency);

Expand Down
2 changes: 1 addition & 1 deletion library/test/src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,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;
}
// N.B., 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 fbb3dd4

Please sign in to comment.