From f5304761b315a961fe2c1165907bf35a084a7c86 Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Tue, 6 Aug 2024 20:15:48 -0700 Subject: [PATCH] fix(common): Remove unused import (#9387) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moving the import under the tty-emitter feature fixes the following: warning: unused import: `IsTerminal` --> /home/user/swc/crates/swc_common/src/errors/emitter.rs:15:28 | 15 | io::{self, prelude::*, IsTerminal}, | ^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default --------- Co-authored-by: Donny/강동윤 --- .changeset/slow-forks-brake.md | 6 ++++++ crates/swc_common/src/errors/emitter.rs | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/slow-forks-brake.md diff --git a/.changeset/slow-forks-brake.md b/.changeset/slow-forks-brake.md new file mode 100644 index 000000000000..fc67e76122c3 --- /dev/null +++ b/.changeset/slow-forks-brake.md @@ -0,0 +1,6 @@ +--- +swc_common: patch +swc_core: patch +--- + +fix(common): Remove unused import diff --git a/crates/swc_common/src/errors/emitter.rs b/crates/swc_common/src/errors/emitter.rs index beabb6663dbe..7133983ce065 100644 --- a/crates/swc_common/src/errors/emitter.rs +++ b/crates/swc_common/src/errors/emitter.rs @@ -12,7 +12,7 @@ use std::{ borrow::Cow, cmp::{min, Reverse}, collections::HashMap, - io::{self, prelude::*, IsTerminal}, + io::{self, prelude::*}, }; #[cfg(feature = "tty-emitter")] @@ -116,6 +116,8 @@ pub enum ColorConfig { impl ColorConfig { #[cfg(feature = "tty-emitter")] fn to_color_choice(self) -> ColorChoice { + use std::io::IsTerminal; + let stderr = io::stderr(); match self {