Radish alpha
r
rad:zwTxygwuz5LDGBq255RA2CbNGrz8
Radicle CI broker
Radicle
Git
chore: inline variables to format strings
Lars Wirzenius committed 10 months ago
commit d5f684b2ec12dc875ec0278c8e2fe71faaa88d38
parent d824691
8 files changed +11 -11
modified src/bin/cibtool.rs
@@ -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);
modified src/bin/cibtoolcmd/event.rs
@@ -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");
                }
modified src/bin/cibtoolcmd/message.rs
@@ -41,7 +41,7 @@ impl Leaf for MessageCmd {
            MessageKind::Failure => response_json(failure()?)?,
        };

-
        println!("{}", msg);
+
        println!("{msg}");

        Ok(())
    }
modified src/bin/cibtoolcmd/timeout.rs
@@ -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(())
modified src/msg.rs
@@ -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(())
    }
modified src/pages.rs
@@ -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(
modified src/run.rs
@@ -177,7 +177,7 @@ impl fmt::Display for RunState {
            Self::Running => "running",
            Self::Triggered => "triggered",
        };
-
        write!(f, "{}", s)
+
        write!(f, "{s}")
    }
}

modified src/sensitive.rs
@@ -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}")
    }
}