From a3e4b7ff5f5dfaf956c14f33dc0bbdf8dcfb12db Mon Sep 17 00:00:00 2001 From: Praveen Perera Date: Thu, 15 Oct 2026 15:50:44 -0500 Subject: [PATCH] Fix clippy lints from newer stable Rust Remove a needless return and derive Default for Format instead of hand-writing the impl, so cargo clippy -D warnings passes again. --- src/app.rs | 7 ++++--- src/main.rs | 6 ------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/app.rs b/src/app.rs index 16fa273..5e541d3 100644 --- a/src/app.rs +++ b/src/app.rs @@ -19,8 +19,9 @@ enum WriteMode { DryRun, } -#[derive(Debug, Clone, clap::ValueEnum)] +#[derive(Debug, Clone, Default, clap::ValueEnum)] pub enum Format { + #[default] Yaml, JsonArray, JsonK8s, @@ -194,11 +195,11 @@ impl App { fn get_yamls_iter(&self) -> Vec { if let Some(files) = &self.files { - return files + files .iter() .flat_map(|path| convert_to_yaml(path)) .flatten() - .collect(); + .collect() } else { let mut yamls = Vec::new(); diff --git a/src/main.rs b/src/main.rs index e38037a..b03fa7b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,12 +68,6 @@ pub(crate) struct CliArgs { pub(crate) format: Format, } -impl Default for Format { - fn default() -> Self { - Self::Yaml - } -} - impl Display for Format { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self {