From 609e050852ad6bac83acdf7d28aa2615d519b112 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Wed, 17 Dec 2025 00:50:55 +0100 Subject: Apply formatting --- src/main.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index d443b18..c6201db 100644 --- a/src/main.rs +++ b/src/main.rs @@ -81,7 +81,7 @@ fn parse_arguments() -> Result { use lexopt::prelude::*; let mut input = None; - let mut output: String = "".to_string(); + let mut output: String = String::new(); let mut stage = StageType::Activities; let mut image_type = ImageType::Png; @@ -93,7 +93,7 @@ fn parse_arguments() -> Result { } Short('s') | Long("stage") => { let stage_string: String = argument_parser.value()?.parse()?; - stage = stage_from_str(&stage_string).ok_or("Invalid stage name")? + stage = stage_from_str(&stage_string).ok_or("Invalid stage name")?; } Short('o') | Long("output") => { output = argument_parser.value()?.parse()?; @@ -109,9 +109,10 @@ fn parse_arguments() -> Result { } } let input = PathBuf::from(input.ok_or("missing argument INPUT_FILE")?); - let output = match output.is_empty() { - true => input.with_extension(image_type.to_string()), - false => PathBuf::from(output), + let output = if output.is_empty() { + input.with_extension(image_type.to_string()) + } else { + PathBuf::from(output) }; Ok(Arguments { -- cgit