tidy comments

This commit is contained in:
Jay 2020-05-11 22:43:40 +01:00 committed by Abin Simon
parent 460b8459ca
commit 736e9b7564

View file

@ -187,14 +187,14 @@ impl Meta {
} }
pub fn from_path(path: &PathBuf) -> Result<Self, std::io::Error> { pub fn from_path(path: &PathBuf) -> Result<Self, std::io::Error> {
// If the file is a link, retrieve the metadata without following
// the link, but provides if followed link is_dir. Broken links are files.
let (metadata, symlink_is_dir) = if read_link(path).is_ok() { let (metadata, symlink_is_dir) = if read_link(path).is_ok() {
// If the file is a link, retrieve the metadata without following
// the link, but provides whether followed link is_dir. Broken links are files.
( (
path.symlink_metadata()?, path.symlink_metadata()?,
match path.metadata() { match path.metadata() {
Ok(m) => Some(m.is_dir()), Ok(m) => Some(m.is_dir()),
Err(_) => Some(false), Err(_) => Some(false), // broken link
}, },
) )
} else { } else {