mirror of
https://seed.radicle.dev/rad:zwTxygwuz5LDGBq255RA2CbNGrz8.git
synced 2026-10-18 19:30:29 +08:00
chore: inline variables to format strings
Found by new clippy. Signed-off-by: Lars Wirzenius <liw@liw.fi>
This commit is contained in:
+2
-2
@@ -43,10 +43,10 @@ mod cibtoolcmd;
|
||||
fn main() {
|
||||
logger::open(logger::LogLevel::Info);
|
||||
if let Err(e) = fallible_main() {
|
||||
eprintln!("ERROR: {}", e);
|
||||
eprintln!("ERROR: {e}");
|
||||
let mut e = e.source();
|
||||
while let Some(source) = e {
|
||||
eprintln!("caused by: {}", source);
|
||||
eprintln!("caused by: {source}");
|
||||
e = source.source();
|
||||
}
|
||||
exit(1);
|
||||
|
||||
@@ -39,11 +39,11 @@ impl Leaf for ListEvents {
|
||||
let events = events?;
|
||||
let json =
|
||||
serde_json::to_string_pretty(&events).map_err(CibToolError::EventListToJson)?;
|
||||
println!("{}", json);
|
||||
println!("{json}");
|
||||
} else if self.verbose {
|
||||
for id in event_ids {
|
||||
if let Some(e) = db.get_queued_ci_event(&id)? {
|
||||
println!("{id}: {:?}", e);
|
||||
println!("{id}: {e:?}");
|
||||
} else {
|
||||
println!("{id}: No such event");
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ impl Leaf for MessageCmd {
|
||||
MessageKind::Failure => response_json(failure()?)?,
|
||||
};
|
||||
|
||||
println!("{}", msg);
|
||||
println!("{msg}");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ impl Leaf for TimeoutCmd {
|
||||
|
||||
println!("stdout bytes: {stdout_bytes}");
|
||||
println!("duration: {} ms", elapsed.as_millis());
|
||||
println!("speed: {:.0} B/s", speed);
|
||||
println!("speed: {speed:.0} B/s");
|
||||
println!("exit: {}", tor.exit_code());
|
||||
|
||||
Ok(())
|
||||
|
||||
+1
-1
@@ -722,7 +722,7 @@ impl std::fmt::Display for Author {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{}", self.id)?;
|
||||
if let Some(alias) = &self.alias {
|
||||
write!(f, " ({})", alias)?;
|
||||
write!(f, " ({alias})")?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
+1
-1
@@ -337,7 +337,7 @@ impl PageData {
|
||||
fn per_repo_page_as_html(&self, rid: RepoId, alias: &str, timestamp: &str) -> HtmlPage {
|
||||
let mut doc = HtmlPage::default();
|
||||
|
||||
let title = format!("CI runs for repository {}", alias);
|
||||
let title = format!("CI runs for repository {alias}");
|
||||
Self::head(&mut doc, &title);
|
||||
|
||||
doc.push_to_body(
|
||||
|
||||
+1
-1
@@ -177,7 +177,7 @@ impl fmt::Display for RunState {
|
||||
Self::Running => "running",
|
||||
Self::Triggered => "triggered",
|
||||
};
|
||||
write!(f, "{}", s)
|
||||
write!(f, "{s}")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -34,14 +34,14 @@ pub struct Sensitive {
|
||||
impl fmt::Display for Sensitive {
|
||||
/// Serialize for normal output.
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
write!(f, "{}", PLACEHOLDER)
|
||||
write!(f, "{PLACEHOLDER}")
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Sensitive {
|
||||
/// Serialize for debug output.
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
|
||||
write!(f, "{}", PLACEHOLDER)
|
||||
write!(f, "{PLACEHOLDER}")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user