diff options
| -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 { |