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<()> {
12371237
12381238pub fn stat ( path : & Path ) -> io:: Result < FileAttr > {
12391239 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) ;
12461244 }
12471245 }
12481246 Err ( err)
12491247 }
1250- Ok ( attrs ) => Ok ( attrs ) ,
1248+ result => result ,
12511249 }
12521250}
12531251
You can’t perform that action at this time.
0 commit comments