We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0aad0b3 commit 32c589bCopy full SHA for 32c589b
library/std/src/sys/windows/fs.rs
@@ -1237,17 +1237,15 @@ pub fn link(_original: &Path, _link: &Path) -> io::Result<()> {
1237
1238
pub fn stat(path: &Path) -> io::Result<FileAttr> {
1239
match metadata(path, ReparsePoint::Follow) {
1240
- Err(err) => {
1241
- if err.raw_os_error() == Some(c::ERROR_CANT_ACCESS_FILE as i32) {
1242
- if let Ok(attrs) = lstat(path) {
1243
- if !attrs.file_type().is_symlink() {
1244
- return Ok(attrs);
1245
- }
+ 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);
1246
}
1247
1248
Err(err)
1249
1250
- Ok(attrs) => Ok(attrs),
+ result => result,
1251
1252
1253
0 commit comments