We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
.eq_ignore_ascii_case()
ColorableTerminal::new
1 parent 988f14a commit 368f133Copy full SHA for 368f133
src/currentprocess/terminalsource.rs
@@ -84,12 +84,9 @@ impl ColorableTerminal {
84
/// then color commands will be sent to the stream.
85
/// Otherwise color commands are discarded.
86
pub(super) fn new(stream: StreamSelector) -> Self {
87
- let env_override = process()
88
- .var("RUSTUP_TERM_COLOR")
89
- .map(|it| it.to_lowercase());
90
- let choice = match env_override.as_deref() {
91
- Ok("always") => ColorChoice::Always,
92
- Ok("never") => ColorChoice::Never,
+ let choice = match process().var("RUSTUP_TERM_COLOR") {
+ Ok(s) if s.eq_ignore_ascii_case("always") => ColorChoice::Always,
+ Ok(s) if s.eq_ignore_ascii_case("never") => ColorChoice::Never,
93
_ if stream.is_a_tty() => ColorChoice::Auto,
94
_ => ColorChoice::Never,
95
};
0 commit comments