File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ use crate::{
19
19
currentprocess:: { process, varsource:: VarSource } ,
20
20
env_var, install,
21
21
notifications:: Notification ,
22
- utils:: { raw:: open_dir , utils} ,
22
+ utils:: { raw:: open_dir_following_links , utils} ,
23
23
RustupError ,
24
24
} ;
25
25
@@ -62,7 +62,7 @@ impl<'a> Toolchain<'a> {
62
62
let base_name = path
63
63
. file_name ( )
64
64
. ok_or_else ( || RustupError :: InvalidToolchainName ( name. to_string ( ) ) ) ?;
65
- let parent_dir = match open_dir ( parent) {
65
+ let parent_dir = match open_dir_following_links ( parent) {
66
66
Ok ( d) => d,
67
67
Err ( e) if e. kind ( ) == io:: ErrorKind :: NotFound => return Ok ( false ) ,
68
68
e => e?,
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ pub fn is_file<P: AsRef<Path>>(path: P) -> bool {
31
31
}
32
32
33
33
#[ cfg( windows) ]
34
- pub fn open_dir ( p : & Path ) -> std:: io:: Result < File > {
34
+ pub fn open_dir_following_links ( p : & Path ) -> std:: io:: Result < File > {
35
35
use std:: fs:: OpenOptions ;
36
36
use std:: os:: windows:: fs:: OpenOptionsExt ;
37
37
@@ -42,8 +42,9 @@ pub fn open_dir(p: &Path) -> std::io::Result<File> {
42
42
options. custom_flags ( FILE_FLAG_BACKUP_SEMANTICS ) ;
43
43
options. open ( p)
44
44
}
45
+
45
46
#[ cfg( not( windows) ) ]
46
- pub fn open_dir ( p : & Path ) -> std:: io:: Result < File > {
47
+ pub fn open_dir_following_links ( p : & Path ) -> std:: io:: Result < File > {
47
48
use std:: fs:: OpenOptions ;
48
49
49
50
let mut options = OpenOptions :: new ( ) ;
You can’t perform that action at this time.
0 commit comments