From 7d31a559ec97524c839fbf948e09631850e424e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tau=20G=C3=A4rtli?= Date: Tue, 16 Apr 2024 14:43:35 +0200 Subject: [PATCH] Remove cargo feature --- Cargo.toml | 5 ++--- src/theme.rs | 12 ------------ 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bed1eb1a..03877c30 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ edition = '2021' rust-version = "1.70" [features] -default = ["application", "detect-color-scheme"] +default = ["application"] # Feature required for bat the application. Should be disabled when depending on # bat as a library. application = [ @@ -35,7 +35,6 @@ git = ["git2"] # Support indicating git modifications paging = ["shell-words", "grep-cli"] # Support applying a pager on the output lessopen = ["run_script", "os_str_bytes"] # Support $LESSOPEN preprocessor build-assets = ["syntect/yaml-load", "syntect/plist-load", "regex", "walkdir"] -detect-color-scheme = ["dep:terminal-colorsaurus"] # You need to use one of these if you depend on bat as a library: regex-onig = ["syntect/regex-onig"] # Use the "oniguruma" regex engine @@ -69,7 +68,7 @@ bytesize = { version = "1.3.0" } encoding_rs = "0.8.33" os_str_bytes = { version = "~6.6", optional = true } run_script = { version = "^0.10.1", optional = true} -terminal-colorsaurus = { version = "0.3.1", optional = true } +terminal-colorsaurus = { version = "0.3.1" } [dependencies.git2] version = "0.18" diff --git a/src/theme.rs b/src/theme.rs index 665d0cb9..89627049 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -124,7 +124,6 @@ trait ColorSchemeDetector { struct TerminalColorSchemeDetector; -#[cfg(feature = "detect-color-scheme")] impl ColorSchemeDetector for TerminalColorSchemeDetector { fn should_detect(&self) -> bool { // Querying the terminal for its colors via OSC 10 / OSC 11 requires "exclusive" access @@ -150,17 +149,6 @@ impl ColorSchemeDetector for TerminalColorSchemeDetector { } } -#[cfg(not(feature = "detect-color-scheme"))] -impl ColorSchemeDetector for TerminalColorSchemeDetector { - fn should_detect(&self) -> bool { - false - } - - fn detect(&self) -> Option { - None - } -} - #[cfg(test)] impl ColorSchemeDetector for Option { fn should_detect(&self) -> bool {