Skip to content

Commit

Permalink
fix(common): Remove unused import (#9387)
Browse files Browse the repository at this point in the history
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/강동윤 <[email protected]>
  • Loading branch information
crawford and kdy1 authored Aug 7, 2024
1 parent 4e854c7 commit f530476
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/slow-forks-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
swc_common: patch
swc_core: patch
---

fix(common): Remove unused import
4 changes: 3 additions & 1 deletion crates/swc_common/src/errors/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::{
borrow::Cow,
cmp::{min, Reverse},
collections::HashMap,
io::{self, prelude::*, IsTerminal},
io::{self, prelude::*},
};

#[cfg(feature = "tty-emitter")]
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit f530476

Please sign in to comment.