File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,9 @@ impl ColorableTerminal {
8383 /// then color commands will be sent to the stream.
8484 /// Otherwise color commands are discarded.
8585 pub ( super ) fn new ( stream : StreamSelector ) -> Self {
86- let env_override = process ( ) . var ( "RUSTUP_TERM_COLOR" ) ;
86+ let env_override = process ( )
87+ . var ( "RUSTUP_TERM_COLOR" )
88+ . map ( |it| it. to_lowercase ( ) ) ;
8789 let choice = match env_override. as_deref ( ) {
8890 Ok ( "always" ) => ColorChoice :: Always ,
8991 Ok ( "never" ) => ColorChoice :: Never ,
@@ -260,24 +262,24 @@ mod tests {
260262 }
261263
262264 assert_color_choice (
263- "always " ,
265+ "aLWayS " ,
264266 StreamSelector :: TestWriter ( Default :: default ( ) ) ,
265267 ColorChoice :: Always ,
266268 ) ;
267269 assert_color_choice (
268- "never " ,
270+ "neVer " ,
269271 StreamSelector :: TestWriter ( Default :: default ( ) ) ,
270272 ColorChoice :: Never ,
271273 ) ;
272274 // tty + `auto` enables the colors.
273275 assert_color_choice (
274- "auto " ,
276+ "AutO " ,
275277 StreamSelector :: TestTtyWriter ( Default :: default ( ) ) ,
276278 ColorChoice :: Auto ,
277279 ) ;
278280 // non-tty + `auto` does not enable the colors.
279281 assert_color_choice (
280- "auto " ,
282+ "aUTo " ,
281283 StreamSelector :: TestWriter ( Default :: default ( ) ) ,
282284 ColorChoice :: Never ,
283285 ) ;
You can’t perform that action at this time.
0 commit comments