From 700428ed470b1c046a9c638cb85e0bdf2e009ee9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 17:49:18 +0000 Subject: [PATCH 1/2] Update Rust crate toml to 0.9.0 --- Cargo.lock | 37 ++++++++++++++++--------------------- Cargo.toml | 2 +- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9e0fce2..bcdfd16 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -840,9 +840,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.9" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +checksum = "40734c41988f7306bb04f0ecf60ec0f3f1caa34290e4e8ea471dcd3346483b83" dependencies = [ "serde", ] @@ -1070,44 +1070,42 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.23" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +checksum = "f271e09bde39ab52250160a67e88577e0559ad77e9085de6e9051a2c4353f8f8" dependencies = [ + "indexmap", "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_parser", + "toml_writer", + "winnow", ] [[package]] name = "toml_datetime" -version = "0.6.11" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +checksum = "bade1c3e902f58d73d3f294cd7f20391c1cb2fbcb643b73566bc773971df91e3" dependencies = [ "serde", ] [[package]] -name = "toml_edit" -version = "0.22.27" +name = "toml_parser" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +checksum = "b5c1c469eda89749d2230d8156a5969a69ffe0d6d01200581cdc6110674d293e" dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "toml_write", "winnow", ] [[package]] -name = "toml_write" -version = "0.1.2" +name = "toml_writer" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" +checksum = "b679217f2848de74cabd3e8fc5e6d66f40b7da40f8e1954d92054d9010690fd5" [[package]] name = "typenum" @@ -1542,9 +1540,6 @@ name = "winnow" version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" -dependencies = [ - "memchr", -] [[package]] name = "wit-bindgen-rt" diff --git a/Cargo.toml b/Cargo.toml index 3aea807..3a61d13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ anyhow = "1.0.98" thiserror = "2.0.12" tera = "1" serde_json = "1.0.140" -toml = "0.8.20" +toml = "0.9.0" shell-words = "1.1.0" [dev-dependencies] From f1896794925fdb52bdca0ac1963caa2a52912bea Mon Sep 17 00:00:00 2001 From: Max Dymond Date: Mon, 14 Jul 2025 15:20:00 +0100 Subject: [PATCH 2/2] Fix clippy moans Signed-off-by: Max Dymond --- src/command.rs | 2 +- src/config.rs | 2 +- src/environment.rs | 4 ++-- src/errors.rs | 2 +- src/image.rs | 4 ++-- src/interpret.rs | 2 +- src/main.rs | 2 +- src/spec.rs | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/command.rs b/src/command.rs index a4dd0aa..c876a4c 100644 --- a/src/command.rs +++ b/src/command.rs @@ -191,7 +191,7 @@ pub fn enable_forward_ssh_agent( command: DockerCommandBuilder, agent_socket: &OsStr, ) -> DockerCommandBuilder { - debug!("Got SSH_AUTH_SOCK={:?}", agent_socket); + debug!("Got SSH_AUTH_SOCK={agent_socket:?}"); let dir = path::Path::new(agent_socket).to_path_buf(); command .add_environment("SSH_AUTH_SOCK", agent_socket) diff --git a/src/config.rs b/src/config.rs index 898526e..42d1cba 100644 --- a/src/config.rs +++ b/src/config.rs @@ -210,7 +210,7 @@ impl FlokiConfig { } pub fn from_file(file: &Path) -> Result { - debug!("Reading configuration file: {:?}", file); + debug!("Reading configuration file: {file:?}"); // Render the output from the configuration file before parsing. let output = Self::render(file)?; diff --git a/src/environment.rs b/src/environment.rs index 5546227..bdb0331 100644 --- a/src/environment.rs +++ b/src/environment.rs @@ -18,7 +18,7 @@ impl User { fn current() -> Self { let uid = nix::unistd::getuid(); let gid = nix::unistd::getgid(); - debug!("Current user has uid {} and group {}", uid, gid); + debug!("Current user has uid {uid} and group {gid}"); Self { uid, gid } } } @@ -109,7 +109,7 @@ fn resolve_floki_root_and_config( /// Resolve a directory for floki to use for user-global file (caches etc) fn get_floki_work_path(uid: nix::unistd::Uid) -> path::PathBuf { - let root: path::PathBuf = env::var("HOME").unwrap_or(format!("/tmp/{}/", uid)).into(); + let root: path::PathBuf = env::var("HOME").unwrap_or(format!("/tmp/{uid}/")).into(); root.join(".floki") } diff --git a/src/errors.rs b/src/errors.rs index 3cadef6..fe15d16 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -78,7 +78,7 @@ pub enum FlokiError { /// Generate a summary string for a process exiting fn exit_code_diagnosis(exit_status: &ExitStatus) -> String { match exit_status.code() { - Some(rc) => format!("exited with return code {}", rc), + Some(rc) => format!("exited with return code {rc}"), None => "terminated by a signal".to_string(), } } diff --git a/src/image.rs b/src/image.rs index 2c4f110..58846dd 100644 --- a/src/image.rs +++ b/src/image.rs @@ -145,7 +145,7 @@ impl Image { /// Wrapper to pull an image by it's name pub fn pull_image(name: &str) -> Result<(), Error> { - debug!("Pulling image: {}", name); + debug!("Pulling image: {name}"); let exit_status = Command::new("docker") .arg("pull") .arg(name) @@ -168,7 +168,7 @@ pub fn pull_image(name: &str) -> Result<(), Error> { /// Determine whether an image exists locally pub fn image_exists_locally(name: &str) -> Result { - debug!("Checking for image: {}", name); + debug!("Checking for image: {name}"); let ret = Command::new("docker") .args(["history", name]) .stdin(Stdio::null()) diff --git a/src/interpret.rs b/src/interpret.rs index a8ef3d3..d96646b 100644 --- a/src/interpret.rs +++ b/src/interpret.rs @@ -37,7 +37,7 @@ pub(crate) fn run_floki_container( } if let Some(entrypoint) = &spec.entrypoint { - cmd = cmd.add_docker_switch(format!("--entrypoint={}", entrypoint)) + cmd = cmd.add_docker_switch(format!("--entrypoint={entrypoint}")) } for switch in &spec.docker_switches { diff --git a/src/main.rs b/src/main.rs index 298e81f..61a58d3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,7 +27,7 @@ fn main() -> Result<(), Error> { match run_floki_from_args(&args) { Ok(()) => (), Err(e) => { - error!("A problem occurred: {}", e); + error!("A problem occurred: {e}"); std::process::exit(1); } } diff --git a/src/spec.rs b/src/spec.rs index be9dccc..69009e9 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -133,7 +133,7 @@ impl FlokiSpec { paths, }; - debug!("built spec from config and environment: {:?}", spec); + debug!("built spec from config and environment: {spec:?}"); Ok(spec) }