diff --git a/process/drivers.rs b/process/drivers.rs index 3e5a6ac..c9af3b7 100644 --- a/process/drivers.rs +++ b/process/drivers.rs @@ -78,6 +78,7 @@ static BUILD_ID: std::sync::LazyLock = std::sync::LazyLock::new(Uuid::new_ /// If the args are left uninitialized, the program will determine /// the best one available. #[derive(Default, Clone, Copy, Debug, Builder, Args)] +#[allow(clippy::struct_field_names)] pub struct DriverArgs { /// Select which driver to use to build /// your image. diff --git a/process/drivers/docker_driver.rs b/process/drivers/docker_driver.rs index 6184530..f6ba193 100644 --- a/process/drivers/docker_driver.rs +++ b/process/drivers/docker_driver.rs @@ -466,7 +466,7 @@ fn build_tag_push_cmd(opts: &BuildTagPushOpts<'_>, first_image: &str) -> Command fn get_final_images(opts: &BuildTagPushOpts<'_>) -> Vec { match &opts.image { ImageRef::Remote(image) => { - let images = if opts.tags.is_empty() { + if opts.tags.is_empty() { let image = image.to_string(); string_vec![image] } else { @@ -474,9 +474,7 @@ fn get_final_images(opts: &BuildTagPushOpts<'_>) -> Vec { .iter() .map(|tag| format!("{}/{}:{tag}", image.resolve_registry(), image.repository())) .collect() - }; - - images + } } ImageRef::LocalTar(archive_path) => { string_vec![archive_path.display().to_string()] diff --git a/recipe/src/module_ext.rs b/recipe/src/module_ext.rs index d7147eb..7139dae 100644 --- a/recipe/src/module_ext.rs +++ b/recipe/src/module_ext.rs @@ -20,7 +20,6 @@ pub struct ModuleExt<'a> { impl FromFileList for ModuleExt<'_> { const LIST_KEY: &'static str = "modules"; - #[must_use] fn get_from_file_paths(&self) -> Vec { self.modules .iter() diff --git a/recipe/src/stages_ext.rs b/recipe/src/stages_ext.rs index 4a6ab34..a0fc4d2 100644 --- a/recipe/src/stages_ext.rs +++ b/recipe/src/stages_ext.rs @@ -18,7 +18,6 @@ pub struct StagesExt<'a> { impl FromFileList for StagesExt<'_> { const LIST_KEY: &'static str = "stages"; - #[must_use] fn get_from_file_paths(&self) -> Vec { self.stages .iter() diff --git a/src/commands/init.rs b/src/commands/init.rs index ab3904a..0292cac 100644 --- a/src/commands/init.rs +++ b/src/commands/init.rs @@ -427,7 +427,7 @@ impl InitCommand { .ok_or_else(|| miette!("Couldn't get parent directory from {ci_file_path:?}"))?; fs::create_dir_all(parent_path) .into_diagnostic() - .with_context(|| format!("Couldn't create directory path {parent_path:?}"))?; + .with_context(|| format!("Couldn't create directory path {}", parent_path.display()))?; let file = &mut BufWriter::new( OpenOptions::new() @@ -436,14 +436,14 @@ impl InitCommand { .write(true) .open(&ci_file_path) .into_diagnostic() - .with_context(|| format!("Failed to open file at {ci_file_path:?}"))?, + .with_context(|| format!("Failed to open file at {}", ci_file_path.display()))?, ); let template = ci_provider.render_file()?; writeln!(file, "{template}") .into_diagnostic() - .with_context(|| format!("Failed to write CI file {ci_file_path:?}")) + .with_context(|| format!("Failed to write CI file {}", ci_file_path.display())) } fn update_recipe_file(&self, answers: &Answers) -> Result<()> { @@ -456,10 +456,10 @@ impl InitCommand { .join(RECIPE_PATH) .join(RECIPE_FILE); - debug!("Reading {recipe_path:?}"); + debug!("Reading {}", recipe_path.display()); let file = fs::read_to_string(&recipe_path) .into_diagnostic() - .with_context(|| format!("Failed to read {recipe_path:?}"))?; + .with_context(|| format!("Failed to read {}", recipe_path.display()))?; let description = self .common @@ -502,11 +502,11 @@ impl InitCommand { .write(true) .open(&recipe_path) .into_diagnostic() - .with_context(|| format!("Failed to open {recipe_path:?}"))?, + .with_context(|| format!("Failed to open {}", recipe_path.display()))?, ); write!(file, "{new_file_str}") .into_diagnostic() - .with_context(|| format!("Failed to write to file {recipe_path:?}")) + .with_context(|| format!("Failed to write to file {}", recipe_path.display())) } fn generate_signing_files(&self) -> Result<()> { diff --git a/utils/src/command_output.rs b/utils/src/command_output.rs index b1e74ab..477767d 100644 --- a/utils/src/command_output.rs +++ b/utils/src/command_output.rs @@ -22,15 +22,18 @@ pub struct CommandOutput { /// fn create_command>(binary_name: T) -> Result { let binary_name = binary_name.as_ref(); - log::trace!("Creating Command for binary {binary_name:?}"); + log::trace!("Creating Command for binary {}", binary_name.display()); let full_path = match which::which(binary_name) { Ok(full_path) => { - log::trace!("Using {full_path:?} as {binary_name:?}"); + log::trace!("Using {} as {}", full_path.display(), binary_name.display()); full_path } Err(error) => { - log::trace!("Unable to find {binary_name:?} in PATH, {error:?}"); + log::trace!( + "Unable to find {} in PATH, {error:?}", + binary_name.display() + ); return Err(Error::new(ErrorKind::NotFound, error)); } }; @@ -68,7 +71,7 @@ fn exec_timeout(cmd: &mut Command, time_limit: Duration) -> Option process, Err(error) => { - log::trace!("Unable to run {:?}, {:?}", cmd.get_program(), error); + log::trace!("Unable to run {}, {:?}", cmd.get_program().display(), error); return None; } }; @@ -112,7 +115,10 @@ fn exec_timeout(cmd: &mut Command, time_limit: Duration) -> Option { - log::warn!("Executing command {:?} timed out.", cmd.get_program()); + log::warn!( + "Executing command {} timed out.", + cmd.get_program().display() + ); log::warn!( "You can set command_timeout in your config to a higher value to allow longer-running commands to keep executing." ); @@ -120,8 +126,8 @@ fn exec_timeout(cmd: &mut Command, time_limit: Duration) -> Option { log::trace!( - "Executing command {:?} failed by: {:?}", - cmd.get_program(), + "Executing command {} failed by: {:?}", + cmd.get_program().display(), error ); None