refactor: simplify output format determination logic in main function
Some checks failed
Continuous Integration / Build and Test on ubuntu-latest (push) Failing after 1m16s
Continuous Integration / Build and Test on windows-latest (push) Has been cancelled

This commit is contained in:
2025-08-24 14:40:38 +02:00
parent 8745c2627e
commit 725891d1b6

View File

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