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:
parent
e24de9d225
commit
470733b323
1 changed files with 4 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue