mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 15:32:06 +00:00
Use IsTerminal in librustdoc
This commit is contained in:
parent
d60ba29b10
commit
e3d44dd4bd
@ -4272,7 +4272,6 @@ version = "0.0.0"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"askama",
|
||||
"atty",
|
||||
"expect-test",
|
||||
"itertools",
|
||||
"minifier",
|
||||
|
@ -9,7 +9,6 @@ path = "lib.rs"
|
||||
[dependencies]
|
||||
arrayvec = { version = "0.7", default-features = false }
|
||||
askama = { version = "0.11", default-features = false, features = ["config"] }
|
||||
atty = "0.2"
|
||||
itertools = "0.10.1"
|
||||
minifier = "0.2.2"
|
||||
once_cell = "1.10.0"
|
||||
|
@ -8,6 +8,7 @@
|
||||
#![feature(box_patterns)]
|
||||
#![feature(control_flow_enum)]
|
||||
#![feature(drain_filter)]
|
||||
#![feature(is_terminal)]
|
||||
#![feature(let_chains)]
|
||||
#![feature(test)]
|
||||
#![feature(never_type)]
|
||||
@ -69,7 +70,7 @@ extern crate jemalloc_sys;
|
||||
|
||||
use std::default::Default;
|
||||
use std::env::{self, VarError};
|
||||
use std::io;
|
||||
use std::io::{self, IsTerminal};
|
||||
use std::process;
|
||||
|
||||
use rustc_driver::abort_on_err;
|
||||
@ -180,7 +181,7 @@ fn init_logging() {
|
||||
let color_logs = match std::env::var("RUSTDOC_LOG_COLOR").as_deref() {
|
||||
Ok("always") => true,
|
||||
Ok("never") => false,
|
||||
Ok("auto") | Err(VarError::NotPresent) => atty::is(atty::Stream::Stdout),
|
||||
Ok("auto") | Err(VarError::NotPresent) => io::stdout().is_terminal(),
|
||||
Ok(value) => early_error(
|
||||
ErrorOutputType::default(),
|
||||
&format!("invalid log color value '{}': expected one of always, never, or auto", value),
|
||||
|
Loading…
Reference in New Issue
Block a user