From 47974dc8f6746a0f941014571f302bbaed79cdbd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 23:33:14 +0000 Subject: [PATCH 1/2] chore(deps): update rust crate insta to v1.43.0 --- Cargo.lock | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ac9abbd..af120d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -191,14 +191,12 @@ dependencies = [ [[package]] name = "insta" -version = "1.42.2" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50259abbaa67d11d2bcafc7ba1d094ed7a0c70e3ce893f0d0997f73558cb3084" +checksum = "ab2d11b2f17a45095b8c3603928ba29d7d918d7129d0d0641a36ba73cf07daa6" dependencies = [ "console", - "linked-hash-map", "once_cell", - "pin-project", "similar", ] @@ -214,12 +212,6 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "memchr" version = "2.7.4" @@ -263,26 +255,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "pin-project" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", -] - [[package]] name = "pretty_assertions" version = "1.4.1" From 3454b613a6ba312848438d8e5db7a607f8e7e552 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 23:34:05 +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); }