File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
library/std/src/sys/windows Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -1237,17 +1237,15 @@ pub fn link(_original: &Path, _link: &Path) -> io::Result<()> {
1237
1237
1238
1238
pub fn stat ( path : & Path ) -> io:: Result < FileAttr > {
1239
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
- }
1240
+ Err ( err) if err. raw_os_error ( ) == Some ( c:: ERROR_CANT_ACCESS_FILE as i32 ) => {
1241
+ if let Ok ( attrs) = lstat ( path) {
1242
+ if !attrs. file_type ( ) . is_symlink ( ) {
1243
+ return Ok ( attrs) ;
1246
1244
}
1247
1245
}
1248
1246
Err ( err)
1249
1247
}
1250
- Ok ( attrs ) => Ok ( attrs ) ,
1248
+ result => result ,
1251
1249
}
1252
1250
}
1253
1251
You can’t perform that action at this time.
0 commit comments