refactor: streamline console format determination logic in main function
Some checks failed
Continuous Integration / Build and Test on ubuntu-latest (push) Successful in 2m5s
Continuous Integration / Build and Test on windows-latest (push) Has been cancelled

This commit is contained in:
2025-08-24 14:45:50 +02:00
parent 725891d1b6
commit 13791a445a

View File

@@ -48,13 +48,13 @@ fn main() -> Result<()> {
let args = Args::parse(); let args = Args::parse();
let mut format = args.format; let mut format = args.format;
if matches!(format, Format::Console) { if matches!(format, Format::Console)
if let Some(output_path) = &args.output { && let Some(output_path) = &args.output
match output_path.extension().and_then(|s| s.to_str()) { {
Some("md") => format = Format::Markdown, match output_path.extension().and_then(|s| s.to_str()) {
Some("txt") => format = Format::Text, Some("md") => format = Format::Markdown,
_ => {} Some("txt") => format = Format::Text,
} _ => {}
} }
} }