1
0
Fork 0
mirror of synced 2025-09-23 20:28:36 +00:00

handle case where path is a directory

This commit is contained in:
schaeff 2019-01-21 14:14:40 +01:00
parent 44b3b7dbc6
commit 138a792a69

View file

@ -32,6 +32,11 @@ fn resolve_with_location(
};
let path = base.join(PathBuf::from(source));
if path.is_dir() {
return Err(io::Error::new(io::ErrorKind::Other, "Not a file"));
}
let (next_location, alias) = generate_next_parameters(&path)?;
File::open(path).and_then(|f| Ok((BufReader::new(f), next_location, alias)))