pub fn parent_dir(path: impl AsRef<Path>) -> Result<PathBuf>
Resolves the parent directory of a path, returning an error if the path has no parent. A path with a single component will return “.”.