diff options
| author | NagaChaitanya Vellanki <pnagato@protonmail.com> | 2023-03-17 10:44:22 -0700 |
|---|---|---|
| committer | NagaChaitanya Vellanki <pnagato@protonmail.com> | 2023-03-17 10:44:22 -0700 |
| commit | 32c589b2363eb96649e5692b4b335777dbeb2f9d (patch) | |
| tree | 7c43aa521ec3c745fcaa9225e0cec07c829af8c4 | |
| parent | 0aad0b32ae05d7d03d0c18c7083edf02c7e3f857 (diff) | |
| download | rust-32c589b2363eb96649e5692b4b335777dbeb2f9d.tar.gz rust-32c589b2363eb96649e5692b4b335777dbeb2f9d.zip | |
Modify code style as per comments
| -rw-r--r-- | library/std/src/sys/windows/fs.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/library/std/src/sys/windows/fs.rs b/library/std/src/sys/windows/fs.rs index ef8f73645be..373157bd9e8 100644 --- a/library/std/src/sys/windows/fs.rs +++ b/library/std/src/sys/windows/fs.rs @@ -1237,17 +1237,15 @@ pub fn link(_original: &Path, _link: &Path) -> io::Result<()> { pub fn stat(path: &Path) -> io::Result<FileAttr> { match metadata(path, ReparsePoint::Follow) { - Err(err) => { - if err.raw_os_error() == Some(c::ERROR_CANT_ACCESS_FILE as i32) { - if let Ok(attrs) = lstat(path) { - if !attrs.file_type().is_symlink() { - return Ok(attrs); - } + Err(err) if err.raw_os_error() == Some(c::ERROR_CANT_ACCESS_FILE as i32) => { + if let Ok(attrs) = lstat(path) { + if !attrs.file_type().is_symlink() { + return Ok(attrs); } } Err(err) } - Ok(attrs) => Ok(attrs), + result => result, } } |
