@@ -124,7 +124,7 @@ these changes will be reverted.
124
124
} ;
125
125
}
126
126
127
- #[ cfg( unix ) ]
127
+ #[ cfg( not ( windows ) ) ]
128
128
macro_rules! pre_install_msg_unix {
129
129
( ) => {
130
130
pre_install_msg_template!(
@@ -155,6 +155,7 @@ but will not be added automatically."
155
155
} ;
156
156
}
157
157
158
+ #[ cfg( not( windows) ) ]
158
159
macro_rules! post_install_msg_unix {
159
160
( ) => {
160
161
r"# Rust is installed now. Great!
@@ -168,6 +169,7 @@ To configure your current shell run `source {cargo_home}/env`
168
169
} ;
169
170
}
170
171
172
+ #[ cfg( windows) ]
171
173
macro_rules! post_install_msg_win {
172
174
( ) => {
173
175
r"# Rust is installed now. Great!
@@ -179,6 +181,7 @@ correct environment, but you may need to restart your current shell.
179
181
} ;
180
182
}
181
183
184
+ #[ cfg( not( windows) ) ]
182
185
macro_rules! post_install_msg_unix_no_modify_path {
183
186
( ) => {
184
187
r"# Rust is installed now. Great!
@@ -191,6 +194,7 @@ To configure your current shell run `source {cargo_home}/env`
191
194
} ;
192
195
}
193
196
197
+ #[ cfg( windows) ]
194
198
macro_rules! post_install_msg_win_no_modify_path {
195
199
( ) => {
196
200
r"# Rust is installed now. Great!
@@ -366,17 +370,23 @@ pub fn install(
366
370
let cargo_home = canonical_cargo_home ( ) ?;
367
371
#[ cfg( windows) ]
368
372
let cargo_home = cargo_home. replace ( '\\' , r"\\" ) ;
369
- let msg = match ( opts. no_modify_path , cfg ! ( unix) ) {
370
- ( false , true ) => format ! ( post_install_msg_unix!( ) , cargo_home = cargo_home) ,
371
- ( false , false ) => format ! ( post_install_msg_win!( ) , cargo_home = cargo_home) ,
372
- ( true , true ) => format ! (
373
- post_install_msg_unix_no_modify_path!( ) ,
374
- cargo_home = cargo_home
375
- ) ,
376
- ( true , false ) => format ! (
373
+ #[ cfg( windows) ]
374
+ let msg = if opts. no_modify_path {
375
+ format ! (
377
376
post_install_msg_win_no_modify_path!( ) ,
378
377
cargo_home = cargo_home
379
- ) ,
378
+ )
379
+ } else {
380
+ format ! ( post_install_msg_win!( ) , cargo_home = cargo_home)
381
+ } ;
382
+ #[ cfg( not( windows) ) ]
383
+ let msg = if opts. no_modify_path {
384
+ format ! (
385
+ post_install_msg_unix_no_modify_path!( ) ,
386
+ cargo_home = cargo_home
387
+ )
388
+ } else {
389
+ format ! ( post_install_msg_unix!( ) , cargo_home = cargo_home)
380
390
} ;
381
391
md ( & mut term, msg) ;
382
392
0 commit comments