File tree 1 file changed +3
-5
lines changed
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -78,9 +78,11 @@ fn test_env_set_var() {
78
78
}
79
79
80
80
#[ test]
81
- #[ cfg_attr( any( target_os = "emscripten" , target_env = "sgx" ) , ignore) ]
81
+ #[ cfg_attr( not ( any( unix , windows ) ) , ignore, allow ( unused ) ) ]
82
82
#[ allow( deprecated) ]
83
83
fn env_home_dir ( ) {
84
+ use std:: path:: PathBuf ;
85
+
84
86
fn var_to_os_string ( var : Result < String , VarError > ) -> Option < OsString > {
85
87
match var {
86
88
Ok ( var) => Some ( OsString :: from ( var) ) ,
@@ -91,8 +93,6 @@ fn env_home_dir() {
91
93
92
94
cfg_if:: cfg_if! {
93
95
if #[ cfg( unix) ] {
94
- use std:: path:: PathBuf ;
95
-
96
96
let oldhome = var_to_os_string( var( "HOME" ) ) ;
97
97
98
98
set_var( "HOME" , "/home/MountainView" ) ;
@@ -110,8 +110,6 @@ fn env_home_dir() {
110
110
111
111
if let Some ( oldhome) = oldhome { set_var( "HOME" , oldhome) ; }
112
112
} else if #[ cfg( windows) ] {
113
- use std:: path:: PathBuf ;
114
-
115
113
let oldhome = var_to_os_string( var( "HOME" ) ) ;
116
114
let olduserprofile = var_to_os_string( var( "USERPROFILE" ) ) ;
117
115
You can’t perform that action at this time.
0 commit comments