From d38d7aaac082eb0cd5c195c1f7261ba9e437b476 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 18:29:16 +0000 Subject: [PATCH 1/2] fix(deps): update rust crate derive_setters to v0.1.7 --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ac9abbd..b0cb6fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -88,9 +88,9 @@ dependencies = [ [[package]] name = "derive_setters" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e8ef033054e131169b8f0f9a7af8f5533a9436fadf3c500ed547f730f07090d" +checksum = "d9c848e86c87e5cc305313041c5677d4d95d60baa71cf95e5f6ea2554bb629ff" dependencies = [ "darling", "proc-macro2", From 9c704cdd122160506755c6850e7ba52e2a3fddb7 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 18:30:09 +0000 Subject: [PATCH 2/2] [autofix.ci] apply automated fixes --- crates/gh-workflow/src/cargo.rs | 2 +- crates/gh-workflow/src/ctx.rs | 14 +++++++------- crates/gh-workflow/src/generate.rs | 7 +++---- crates/gh-workflow/src/rust_flag.rs | 14 +++++++------- crates/gh-workflow/src/toolchain.rs | 18 +++++++++--------- 5 files changed, 27 insertions(+), 28 deletions(-) diff --git a/crates/gh-workflow/src/cargo.rs b/crates/gh-workflow/src/cargo.rs index bb4e511..35c34d3 100644 --- a/crates/gh-workflow/src/cargo.rs +++ b/crates/gh-workflow/src/cargo.rs @@ -74,7 +74,7 @@ impl From for Step { let mut command = vec!["cargo".to_string()]; if let Some(toolchain) = value.toolchain { - command.push(format!("+{}", toolchain)); + command.push(format!("+{toolchain}")); } command.push(value.command); diff --git a/crates/gh-workflow/src/ctx.rs b/crates/gh-workflow/src/ctx.rs index d325c39..d793052 100644 --- a/crates/gh-workflow/src/ctx.rs +++ b/crates/gh-workflow/src/ctx.rs @@ -202,25 +202,25 @@ impl fmt::Display for Step { Step::Root => write!(f, ""), Step::Select { name, object } => { if matches!(**object, Step::Root) { - write!(f, "{}", name) + write!(f, "{name}") } else { - write!(f, "{}.{}", object, name) + write!(f, "{object}.{name}") } } Step::Eq { left, right } => { - write!(f, "{} == {}", left, right) + write!(f, "{left} == {right}") } Step::And { left, right } => { - write!(f, "{} && {}", left, right) + write!(f, "{left} && {right}") } Step::Or { left, right } => { - write!(f, "{} || {}", left, right) + write!(f, "{left} || {right}") } Step::Literal(value) => { - write!(f, "'{}'", value) + write!(f, "'{value}'") } Step::Concat { left, right } => { - write!(f, "{}{}", left, right) + write!(f, "{left}{right}") } } } diff --git a/crates/gh-workflow/src/generate.rs b/crates/gh-workflow/src/generate.rs index e1204f6..54ab19a 100644 --- a/crates/gh-workflow/src/generate.rs +++ b/crates/gh-workflow/src/generate.rs @@ -1,7 +1,6 @@ //! This module provides functionality to customize generation of the GitHub //! Actions workflow files. -use std::io::ErrorKind; use std::path::PathBuf; use std::process::Command; @@ -70,7 +69,7 @@ impl Generate { } Err(Error::MissingWorkflowFile(path)) => { std::fs::create_dir_all(path.parent().ok_or(Error::IO( - std::io::Error::new(ErrorKind::Other, "Invalid parent dir(s) path"), + std::io::Error::other("Invalid parent dir(s) path"), ))?)?; std::fs::write(path.clone(), content)?; println!("Generated workflow file: {}", path.display()); @@ -113,13 +112,13 @@ fn organize_job_dependency(mut workflow: Workflow) -> Workflow { job_ids.push(id.to_owned()); } else { // Create a job-id for the job - let id = format!("job-{}", job_id); + let id = format!("job-{job_id}"); // Add job id as the dependency job_ids.push(id.clone()); // Insert the missing job into the new_jobs - new_jobs.insert(format!("job-{}", job_id), job.clone()); + new_jobs.insert(format!("job-{job_id}"), job.clone()); job_id += 1; } diff --git a/crates/gh-workflow/src/rust_flag.rs b/crates/gh-workflow/src/rust_flag.rs index 3b348fe..5c03499 100644 --- a/crates/gh-workflow/src/rust_flag.rs +++ b/crates/gh-workflow/src/rust_flag.rs @@ -56,14 +56,14 @@ impl Display for RustFlags { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self { RustFlags::Lint(name, lint) => match lint { - Lint::Allow => write!(f, "-A{}", name), - Lint::Warn => write!(f, "-W{}", name), - Lint::Deny => write!(f, "-D{}", name), - Lint::Forbid => write!(f, "-F{}", name), - Lint::Codegen => write!(f, "-C{}", name), - Lint::Experiment => write!(f, "-Z{}", name), + Lint::Allow => write!(f, "-A{name}"), + Lint::Warn => write!(f, "-W{name}"), + Lint::Deny => write!(f, "-D{name}"), + Lint::Forbid => write!(f, "-F{name}"), + Lint::Codegen => write!(f, "-C{name}"), + Lint::Experiment => write!(f, "-Z{name}"), }, - RustFlags::Combine(lhs, rhs) => write!(f, "{} {}", lhs, rhs), + RustFlags::Combine(lhs, rhs) => write!(f, "{lhs} {rhs}"), } } } diff --git a/crates/gh-workflow/src/toolchain.rs b/crates/gh-workflow/src/toolchain.rs index 6450dfd..6125157 100644 --- a/crates/gh-workflow/src/toolchain.rs +++ b/crates/gh-workflow/src/toolchain.rs @@ -44,7 +44,7 @@ impl Display for Component { Component::Rustfmt => "rustfmt", Component::RustDoc => "rust-doc", }; - write!(f, "{}", val) + write!(f, "{val}") } } @@ -64,7 +64,7 @@ impl Display for Arch { Arch::Arm => "arm", Arch::Wasm32 => "wasm32", }; - write!(f, "{}", val) + write!(f, "{val}") } } @@ -82,7 +82,7 @@ impl Display for Vendor { Vendor::Apple => "apple", Vendor::PC => "pc", }; - write!(f, "{}", val) + write!(f, "{val}") } } @@ -102,7 +102,7 @@ impl Display for System { System::Linux => "linux", System::Darwin => "darwin", }; - write!(f, "{}", val) + write!(f, "{val}") } } @@ -122,7 +122,7 @@ impl Display for Abi { Abi::Msvc => "msvc", Abi::Musl => "musl", }; - write!(f, "{}", val) + write!(f, "{val}") } } @@ -205,10 +205,10 @@ impl From for Step { Version::Stable => "stable".to_string(), Version::Nightly => "nightly".to_string(), Version::Custom((major, minor, patch)) => { - format!("{}.{}.{}", major, minor, patch) + format!("{major}.{minor}.{patch}") } }) - .reduce(|acc, a| format!("{}, {}", acc, a)); + .reduce(|acc, a| format!("{acc}, {a}")); let mut input = Input::default(); @@ -233,7 +233,7 @@ impl From for Step { .components .iter() .map(|c| c.to_string()) - .reduce(|acc, a| format!("{}, {}", acc, a)) + .reduce(|acc, a| format!("{acc}, {a}")) .unwrap_or_default(); input = input.add("components", components); @@ -252,7 +252,7 @@ impl From for Step { let cache_workspaces = value .cache_workspaces .iter() - .fold("".to_string(), |acc, a| format!("{}\n{}", acc, a)); + .fold("".to_string(), |acc, a| format!("{acc}\n{a}")); input = input.add("cache-workspaces", cache_workspaces); }