From 91164957ec18aa65aa00412f703f2270e47779c1 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 20 Nov 2024 14:10:44 +1100 Subject: [PATCH] Remove redundant `is_terminal` check. It's not necessary because `show_md_content_with_pager` is only ever called if `is_terminal` is true. --- compiler/rustc_driver_impl/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index 038a0d6c288..6198f40e83d 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -620,8 +620,7 @@ fn show_md_content_with_pager(content: &str, color: ColorConfig) { // to standard output if fallback_to_println { let fmt_success = match color { - ColorConfig::Auto => io::stdout().is_terminal() && bufwtr.print(&mdbuf).is_ok(), - ColorConfig::Always => bufwtr.print(&mdbuf).is_ok(), + ColorConfig::Auto | ColorConfig::Always => bufwtr.print(&mdbuf).is_ok(), ColorConfig::Never => false, };