Skip to content

Commit b83dbcb

Browse files
committed
Reformat code
1 parent 6384992 commit b83dbcb

File tree

11 files changed

+29
-60
lines changed

11 files changed

+29
-60
lines changed

collector/src/bin/collector.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,9 +1064,7 @@ fn main_result() -> anyhow::Result<i32> {
10641064
let sha = commit.sha.to_string();
10651065
let sysroot = rt
10661066
.block_on(Sysroot::install(sha.clone(), &host_target_tuple, &backends))
1067-
.with_context(|| {
1068-
format!("failed to install sysroot for {commit:?}")
1069-
})?;
1067+
.with_context(|| format!("failed to install sysroot for {commit:?}"))?;
10701068

10711069
let mut benchmarks = get_compile_benchmarks(
10721070
&compile_benchmark_dir,
@@ -1928,9 +1926,7 @@ async fn bench_compile(
19281926
);
19291927
let result = measure(&mut processor).await;
19301928
if let Err(s) = result {
1931-
eprintln!(
1932-
"collector error: Failed to benchmark '{benchmark_name}', recorded: {s:#}"
1933-
);
1929+
eprintln!("collector error: Failed to benchmark '{benchmark_name}', recorded: {s:#}");
19341930
errors.incr();
19351931
tx.conn()
19361932
.record_error(

collector/src/compile/execute/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -670,9 +670,7 @@ fn process_stat_output(
670670
continue;
671671
}
672672
if !pct.starts_with("100.") {
673-
panic!(
674-
"measurement of `{name}` only active for {pct}% of the time"
675-
);
673+
panic!("measurement of `{name}` only active for {pct}% of the time");
676674
}
677675
stats.insert(
678676
name.to_owned(),

collector/src/compile/execute/profiler.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,7 @@ impl Processor for ProfileProcessor<'_> {
398398
for (cgu, items) in &by_cgu {
399399
let cgu_file = filepath(&out_dir, cgu);
400400
let mut file = io::BufWriter::new(
401-
fs::File::create(&cgu_file)
402-
.with_context(|| format!("{cgu_file:?}"))?,
401+
fs::File::create(&cgu_file).with_context(|| format!("{cgu_file:?}"))?,
403402
);
404403
for (name, linkage) in items {
405404
writeln!(&mut file, "{name} {linkage}")?;

collector/src/runtime/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,7 @@ pub async fn bench_runtime(
8989
if let Err(error) = result {
9090
eprintln!("collector error: {error:#}");
9191
tx.conn()
92-
.record_error(
93-
collector.artifact_row_id,
94-
&step_name,
95-
&format!("{error:?}"),
96-
)
92+
.record_error(collector.artifact_row_id, &step_name, &format!("{error:?}"))
9793
.await;
9894
};
9995

collector/src/toolchain.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,9 @@ pub fn get_local_toolchain(
483483

484484
let clippy = if let Some(clippy) = &toolchain_config.clippy {
485485
Some(
486-
clippy.canonicalize().with_context(|| {
487-
format!("failed to canonicalize clippy executable {clippy:?}")
488-
})?,
486+
clippy
487+
.canonicalize()
488+
.with_context(|| format!("failed to canonicalize clippy executable {clippy:?}"))?,
489489
)
490490
} else if profiles.contains(&Profile::Clippy) {
491491
// We need a `clippy`. Look for one next to `rustc`.

collector/src/utils/fs.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ pub fn touch_all(path: &Path) -> anyhow::Result<()> {
7979
// We also delete the cmake caches to avoid errors when moving directories around.
8080
// This might be a bit slower but at least things build
8181
if path.file_name() == Some(OsStr::new("CMakeCache.txt")) {
82-
fs::remove_file(path)
83-
.with_context(|| format!("deleting cmake caches in {path:?}"))?;
82+
fs::remove_file(path).with_context(|| format!("deleting cmake caches in {path:?}"))?;
8483
}
8584

8685
if is_valid(path) {

database/src/pool.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -437,11 +437,10 @@ mod tests {
437437
.await
438438
.unwrap();
439439

440-
assert!(
441-
db.mark_benchmark_request_as_completed(request_tag)
442-
.await
443-
.unwrap()
444-
);
440+
assert!(db
441+
.mark_benchmark_request_as_completed(request_tag)
442+
.await
443+
.unwrap());
445444
}
446445

447446
#[tokio::test]
@@ -919,11 +918,10 @@ mod tests {
919918
db.insert_benchmark_request(&benchmark_request)
920919
.await
921920
.unwrap();
922-
assert!(
923-
db.mark_benchmark_request_as_completed("sha-1")
924-
.await
925-
.unwrap()
926-
);
921+
assert!(db
922+
.mark_benchmark_request_as_completed("sha-1")
923+
.await
924+
.unwrap());
927925
Ok(ctx)
928926
})
929927
.await;

site/src/benchmark_metadata/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ fn load_compile_benchmark_metadata() -> HashMap<String, CompileBenchmarkMetadata
5656
} = metadata;
5757
let perf_config: BenchmarkConfig =
5858
serde_json::from_value(perf_config).unwrap_or_else(|error| {
59-
panic!(
60-
"Cannot deserialize perf-config.json for benchmark {name}: {error:?}"
61-
);
59+
panic!("Cannot deserialize perf-config.json for benchmark {name}: {error:?}");
6260
});
6361

6462
let metadata = CompileBenchmarkMetadata {

site/src/comparison.rs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,7 @@ async fn write_triage_summary(
504504
) -> String {
505505
let mut result = if let Some(pr) = comparison.b.pr {
506506
let title = github::pr_title(pr).await;
507-
format!(
508-
"{title} [#{pr}](https://github.com/rust-lang/rust/pull/{pr})"
509-
)
507+
format!("{title} [#{pr}](https://github.com/rust-lang/rust/pull/{pr})")
510508
} else {
511509
String::from("<Unknown Change>")
512510
};
@@ -1447,15 +1445,11 @@ async fn generate_report(
14471445
Ok(u) => u
14481446
.iter()
14491447
.map(|github::PullRequest { title, number }| {
1450-
format!(
1451-
"- [#{number} {title}](https://github.com/rust-lang/rust/pull/{number})"
1452-
)
1448+
format!("- [#{number} {title}](https://github.com/rust-lang/rust/pull/{number})")
14531449
})
14541450
.collect::<Vec<_>>()
14551451
.join("\n"),
1456-
Err(e) => format!(
1457-
"An **error** occurred when finding the untriaged PRs: {e}"
1458-
),
1452+
Err(e) => format!("An **error** occurred when finding the untriaged PRs: {e}"),
14591453
};
14601454
let num_regressions = regressions.len();
14611455
let regressions_suffix = if num_regressions == 1 { "" } else { "s" };
@@ -1528,9 +1522,7 @@ fn compare_link(start: &ArtifactId, end: &ArtifactId) -> String {
15281522
ArtifactId::Tag(a) => a,
15291523
ArtifactId::Commit(c) => &c.sha,
15301524
};
1531-
format!(
1532-
"https://perf.rust-lang.org/compare.html?start={start}&end={end}&stat=instructions:u"
1533-
)
1525+
format!("https://perf.rust-lang.org/compare.html?start={start}&end={end}&stat=instructions:u")
15341526
}
15351527

15361528
#[cfg(test)]
@@ -1753,9 +1745,7 @@ mod tests {
17531745
// We don't use `assert_eq!` here because it stringifies the arguments,
17541746
// making the tables hard to read when printed.
17551747
if result != expected {
1756-
panic!(
1757-
"output mismatch:\nexpected:\n{expected}actual:\n{result}"
1758-
);
1748+
panic!("output mismatch:\nexpected:\n{expected}actual:\n{result}");
17591749
}
17601750
}
17611751
}

site/src/github.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,7 @@ fn github_request(url: &str) -> reqwest::RequestBuilder {
469469
.header("Content-Type", "application/json")
470470
.header("User-Agent", "rustc-perf");
471471
if let Ok(token) = std::env::var("GITHUB_TOKEN") {
472-
let mut value =
473-
reqwest::header::HeaderValue::from_str(&format!("token {token}")).unwrap();
472+
let mut value = reqwest::header::HeaderValue::from_str(&format!("token {token}")).unwrap();
474473
value.set_sensitive(true);
475474
request = request.header("Authorization", value);
476475
}

0 commit comments

Comments
 (0)