From 7610b5c7a602bd8084e23ae57338e0ff4d02a6b0 Mon Sep 17 00:00:00 2001 From: Josh Holmer Date: Wed, 4 May 2022 02:18:13 -0400 Subject: [PATCH] Print a proper error message if the input file does not exist (#626) --- av1an-cli/src/lib.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/av1an-cli/src/lib.rs b/av1an-cli/src/lib.rs index 39d05b1d..fc7be243 100644 --- a/av1an-cli/src/lib.rs +++ b/av1an-cli/src/lib.rs @@ -519,12 +519,12 @@ pub(crate) fn resolve_file_paths(path: &Path) -> anyhow::Result anyhow::Result anyhow::Result> { let input_paths = &*args.input; - let inputs: Vec = input_paths - .iter() - .flat_map(|input| resolve_file_paths(input)) - .flatten() - .collect(); + let mut inputs = Vec::new(); + for path in input_paths { + inputs.extend(resolve_file_paths(path)?); + } let mut valid_args: Vec = Vec::with_capacity(inputs.len());