Fix crash when nonexistent files were passed to parse.

We were unwrapping the result of counting the characters in the vector
returned by collect_files(), which, if that vector is empty, returns
None. The most correct behavior is to halt if a nonexistent filename
was provided or a glob failed.
This commit is contained in:
Patrick Thomson 2020-09-30 15:49:42 -04:00
parent e24de9d225
commit 470733b323

View file

@ -426,6 +426,10 @@ fn collect_paths<'a>(
}
}
if result.is_empty() {
Error::err("No files were found at or matched by the provided pathname/glob".to_string())?;
}
return Ok(result);
}