refactor(cli): simplify output_paths w/ <&[T]>::get and Option::unwrap (#2114)

This commit is contained in:
Erich Gubler 2022-11-04 11:20:47 -04:00 committed by GitHub
parent 01fbdea21f
commit 1650581fe7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -231,11 +231,7 @@ fn run() -> Result<(), Box<dyn std::error::Error>> {
} else { } else {
return Err(CliError("Input file path is not specified").into()); return Err(CliError("Input file path is not specified").into());
}; };
let output_paths = if !args.files.is_empty() { let output_paths = args.files.get(1..).unwrap_or(&[]);
&args.files[1..]
} else {
&[]
};
// Update parameters from commandline arguments // Update parameters from commandline arguments
if let Some(bits) = args.validate { if let Some(bits) = args.validate {