Skip to content

Commit 909b573

Browse files
committed
Fix clippy
1 parent 3c04fce commit 909b573

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

collector/src/bin/collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ fn binary_stats_local(args: BinaryStatsLocal, symbols: bool) -> anyhow::Result<(
11931193
.artifact2
11941194
.as_ref()
11951195
.map(|path| {
1196-
ArtifactStats::from_path(&path)
1196+
ArtifactStats::from_path(path)
11971197
.with_context(|| format!("Cannot load artifact from {}", path.display()))
11981198
})
11991199
.transpose()?;

collector/src/compile/execute/profiler.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl<'a> Processor for ProfileProcessor<'a> {
117117
fs::remove_dir_all(&zsp_dir)?;
118118
}
119119

120-
utils::fs::rename(&tmp_zsp_dir, &zsp_dir)?;
120+
utils::fs::rename(tmp_zsp_dir, &zsp_dir)?;
121121

122122
// Rename the data files. There should be exactly three.
123123
let mut num_files = 0;
@@ -305,8 +305,8 @@ impl<'a> Processor for ProfileProcessor<'a> {
305305
message_type: &'a str,
306306
}
307307

308-
let mut final_file = io::BufWriter::new(std::fs::File::create(&eprintln_file)?);
309-
for line in io::BufReader::new(std::fs::File::open(&tmp_eprintln_file)?).lines()
308+
let mut final_file = io::BufWriter::new(std::fs::File::create(eprintln_file)?);
309+
for line in io::BufReader::new(std::fs::File::open(tmp_eprintln_file)?).lines()
310310
{
311311
let line = line?;
312312

@@ -327,11 +327,11 @@ impl<'a> Processor for ProfileProcessor<'a> {
327327
// dir, giving it a new name in the process.
328328
Profiler::MonoItems => {
329329
let tmp_file = filepath(data.cwd, "mono-items");
330-
let out_dir = self.output_dir.join(&out_file("mono-items"));
330+
let out_dir = self.output_dir.join(out_file("mono-items"));
331331
let _ = fs::create_dir_all(&out_dir);
332332
let result_file = filepath(&out_dir, "raw");
333333

334-
fs::copy(&tmp_file, &result_file)?;
334+
fs::copy(&tmp_file, result_file)?;
335335

336336
let mut by_cgu: HashMap<&str, Vec<(&str, &str)>> = HashMap::new();
337337
let mono_items = std::fs::read_to_string(&tmp_file)?;

site/src/comparison.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ impl ArtifactDescription {
975975
let bootstrap_total = bootstrap
976976
.values()
977977
.filter_map(|v| {
978-
v.get(0)
978+
v.first()
979979
.copied()
980980
.unwrap_or_default()
981981
.map(|v| v.as_nanos() as u64)

site/src/request_handlers/self_profile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ pub async fn handle_self_profile(
534534

535535
let mut self_profile = get_or_download_self_profile(
536536
ctxt,
537-
commits.get(0).unwrap().clone(),
537+
commits.first().unwrap().clone(),
538538
bench_name,
539539
profile,
540540
scenario,

site/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ where
573573
.into_owned()
574574
.collect()
575575
})
576-
.unwrap_or_else(HashMap::new);
576+
.unwrap_or_default();
577577

578578
match serde_json::from_str(&serde_json::to_string(&params).unwrap()) {
579579
Ok(d) => Ok(d),

0 commit comments

Comments
 (0)