From 1650581fe7a94ed40067313f3cd205414dd4febf Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Fri, 4 Nov 2022 11:20:47 -0400 Subject: [PATCH] refactor(cli): simplify `output_paths` w/ `<&[T]>::get` and `Option::unwrap` (#2114) --- cli/src/main.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index f7a3f8312a..b983473a1e 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -231,11 +231,7 @@ fn run() -> Result<(), Box> { } else { return Err(CliError("Input file path is not specified").into()); }; - let output_paths = if !args.files.is_empty() { - &args.files[1..] - } else { - &[] - }; + let output_paths = args.files.get(1..).unwrap_or(&[]); // Update parameters from commandline arguments if let Some(bits) = args.validate {