diff options
| author | Ruben Beltran del Rio <jj@r.bdr.sh> | 2025-12-17 00:50:55 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <jj@r.bdr.sh> | 2025-12-17 00:51:49 +0100 |
| commit | 609e050852ad6bac83acdf7d28aa2615d519b112 (patch) | |
| tree | abf18f4c84f9414f6cf4be832ffe9a7082272106 | |
| parent | d07882b21f5e68b84469a6bf94ce20b06a09a3fa (diff) | |
Apply formatting
| -rw-r--r-- | src/main.rs | 11 |
1 files changed, 6 insertions, 5 deletions
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<Arguments, lexopt::Error> { 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<Arguments, lexopt::Error> { } 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<Arguments, lexopt::Error> { } } 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 { |