Skip to content

Commit 29fb04b

Browse files
committed
make clippy happy
1 parent 61ec5e1 commit 29fb04b

File tree

8 files changed

+10
-18
lines changed

8 files changed

+10
-18
lines changed

src/bin/test-report.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ impl ReportWriter for NullWriter {
7979

8080
impl fmt::Display for NullWriter {
8181
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
82-
write!(f, "{:?}", self)
82+
write!(f, "{self:?}")
8383
}
8484
}

src/db/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<E: std::error::Error> r2d2::HandleError<E> for ErrorHandler {
6060
if log::log_enabled!(log::Level::Error) {
6161
log::error!("r2d2 error: {:?}", error);
6262
} else {
63-
eprintln!("r2d2 error: {:?}", error);
63+
eprintln!("r2d2 error: {error:?}");
6464
}
6565
}
6666
}

src/report/archives.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl Drop for TempfileBackedBuffer {
5151
fn drop(&mut self) {
5252
unsafe {
5353
if let Err(e) = nix::sys::mman::munmap(self.mmap.as_ptr() as *mut _, self.mmap.len()) {
54-
eprintln!("Failed to unmap temporary file: {:?}", e);
54+
eprintln!("Failed to unmap temporary file: {e:?}");
5555
}
5656
}
5757
}

src/runner/worker.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,8 @@ impl<'a> Worker<'a> {
258258
self.ex,
259259
&krate,
260260
tc,
261-
format!(
262-
"{}\n\nthis task or one of its parent failed: {:?}",
263-
logs, err
264-
)
265-
.as_bytes(),
261+
format!("{logs}\n\nthis task or one of its parent failed: {err:?}")
262+
.as_bytes(),
266263
&result,
267264
updated_version.as_ref().map(|new| (&krate, new)),
268265
) {
@@ -329,7 +326,7 @@ impl<'a> Worker<'a> {
329326
self.ex,
330327
&task.krate,
331328
tc,
332-
format!("{}\n\n{:?}", storage, err).as_bytes(),
329+
format!("{storage}\n\n{err:?}").as_bytes(),
333330
&test_result,
334331
updated_version.as_ref().map(|new| (&krate, new)),
335332
)?;

src/server/agents.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ impl Agents {
178178
.transpose()?
179179
.map(|agent| agent.with_capabilities(&self.db))
180180
.transpose()
181-
.map_err(Into::into)
182181
}
183182

184183
pub fn record_heartbeat(&self, agent: &str) -> Fallible<()> {

src/server/routes/ui/experiments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ fn humanize(duration: Duration) -> String {
131131
Ok(d) => d,
132132
Err(_) => {
133133
// Don't try to make it pretty as a fallback.
134-
return format!("{:?}", duration);
134+
return format!("{duration:?}");
135135
}
136136
};
137137
if duration.as_secs() < 60 {

src/server/try_builds.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,8 @@ mod tests {
105105
&format!(
106106
r#"
107107
Try build passed.
108-
<!-- homu: {{"type": "TryBuildCompleted", "merge_sha": "{}"}} -->
109-
"#,
110-
COMMIT_A
108+
<!-- homu: {{"type": "TryBuildCompleted", "merge_sha": "{COMMIT_A}"}} -->
109+
"#
111110
),
112111
)
113112
.unwrap();

tests/minicrater/driver.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,7 @@ trait Compare {
7979
"\n",
8080
);
8181
if changeset.distance != 0 {
82-
eprintln!(
83-
"Difference between expected and actual reports:\n{}",
84-
changeset
85-
);
82+
eprintln!("Difference between expected and actual reports:\n{changeset}");
8683
eprintln!("To expect the new report in the future run:");
8784
eprintln!(
8885
"$ cp {} {}\n",

0 commit comments

Comments
 (0)