diff --git a/Cargo.toml b/Cargo.toml index e4a2a7692..8ba4f4b70 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,13 +25,9 @@ maintenance = { status = "passively-maintained" } [features] # TODO: use `dep:` syntax here and below once MSRV is at least `1.60` -default = ["win_crlf", "csv", "legacy-is-terminal"] +default = ["win_crlf", "csv"] evcxr = [] win_crlf = [] -# This feature is inentionally opt-out (enabled by default) not to break older clients, -# although it may become no-op with a MSRV bummp (which is considered a minor change) and removed with a major update -# TODO: make this feature no-op once MSRV is at least `1.70` -legacy-is-terminal = ["is-terminal"] [[bin]] name = "main" @@ -45,6 +41,9 @@ name = "prettytable" unicode-width = "0.1" term = "0.7" lazy_static = "1.4" -is-terminal = { version = "0.4", optional = true } encode_unicode = "1.0" csv = { version = "1.1", optional = true } + +# TODO: remove it once MSRV is at least `1.70` +[target.'cfg(not(prettytable_is_terminal_implementation = "std"))'.dependencies] +is-terminal = "0.4" diff --git a/src/lib.rs b/src/lib.rs index f2f831bec..c34332400 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -194,9 +194,9 @@ impl<'a> TableSlice<'a> { /// # Returns /// A `Result` holding the number of lines printed, or an `io::Error` if any failure happens pub fn print_tty(&self, force_colorize: bool) -> Result { - #[cfg(not(feature = "legacy-is-terminal"))] + #[cfg(prettytable_is_terminal_implementation = "std")] use std::io::IsTerminal; - #[cfg(feature = "legacy-is-terminal")] + #[cfg(not(prettytable_is_terminal_implementation = "std"))] use is_terminal::IsTerminal; match (stdout(), io::stdout().is_terminal() || force_colorize) {