Description: avoid not-in-Debian crate terminal-colorsaurus Author: Jonas Smedegaard Forwarded: not-needed Last-Update: 2024-10-04 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/Cargo.toml +++ b/Cargo.toml @@ -53,7 +53,6 @@ syntect = "5.0.0" # sysinfo: no default features to disable the use of threads sysinfo = { version = "0.39.3", default-features = false, features = ["system"] } -terminal-colorsaurus = "0.4.8" unicode-segmentation = "1.10.1" # 0.2.0 (and 0.1.13) treats \n as width 1. Lines processed by delta have, lose, # and re-gain \n in various stages, which complicates upgrading. --- a/src/options/theme.rs +++ b/src/options/theme.rs @@ -17,8 +17,6 @@ use bat; use bat::assets::HighlightingAssets; -#[cfg(not(test))] -use terminal_colorsaurus::{color_scheme, QueryOptions}; use crate::cli::{self, DetectDarkLight}; use crate::color::{ColorMode, ColorMode::*}; @@ -101,23 +99,6 @@ } } -#[cfg(not(test))] -fn detect_color_mode() -> Option { - color_scheme(QueryOptions::default()) - .ok() - .map(ColorMode::from) -} - -impl From for ColorMode { - fn from(value: terminal_colorsaurus::ColorScheme) -> Self { - match value { - terminal_colorsaurus::ColorScheme::Dark => ColorMode::Dark, - terminal_colorsaurus::ColorScheme::Light => ColorMode::Light, - } - } -} - -#[cfg(test)] fn detect_color_mode() -> Option { None }