Modify code style as per comments

This commit is contained in:
NagaChaitanya Vellanki 2023-03-17 10:44:22 -07:00
parent 0aad0b32ae
commit 32c589b236
1 changed files with 5 additions and 7 deletions

View File

@ -1237,17 +1237,15 @@ pub fn link(_original: &Path, _link: &Path) -> io::Result<()> {
pub fn stat(path: &Path) -> io::Result<FileAttr> { pub fn stat(path: &Path) -> io::Result<FileAttr> {
match metadata(path, ReparsePoint::Follow) { match metadata(path, ReparsePoint::Follow) {
Err(err) => { Err(err) if err.raw_os_error() == Some(c::ERROR_CANT_ACCESS_FILE as i32) => {
if err.raw_os_error() == Some(c::ERROR_CANT_ACCESS_FILE as i32) { if let Ok(attrs) = lstat(path) {
if let Ok(attrs) = lstat(path) { if !attrs.file_type().is_symlink() {
if !attrs.file_type().is_symlink() { return Ok(attrs);
return Ok(attrs);
}
} }
} }
Err(err) Err(err)
} }
Ok(attrs) => Ok(attrs), result => result,
} }
} }