From 13791a445aeed2ea26bbc1293a948ad0bc1ab233 Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Sun, 24 Aug 2025 14:45:50 +0200 Subject: [PATCH] refactor: streamline console format determination logic in main function --- src/main.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index ccdd19a..2d02931 100644 --- a/src/main.rs +++ b/src/main.rs @@ -48,13 +48,13 @@ fn main() -> Result<()> { let args = Args::parse(); let mut format = args.format; - if matches!(format, Format::Console) { - if let Some(output_path) = &args.output { - match output_path.extension().and_then(|s| s.to_str()) { - Some("md") => format = Format::Markdown, - Some("txt") => format = Format::Text, - _ => {} - } + if matches!(format, Format::Console) + && let Some(output_path) = &args.output + { + match output_path.extension().and_then(|s| s.to_str()) { + Some("md") => format = Format::Markdown, + Some("txt") => format = Format::Text, + _ => {} } }