From 92354a817cb26d80c5cdd7ff739202eef45cad2a Mon Sep 17 00:00:00 2001 From: Stefan Holderbach Date: Mon, 10 Jul 2023 09:24:08 +0200 Subject: [PATCH] Remove duplicated dependency on `ansi-str 0.7` (#9641) # Description `tabled`/`papergrid` already use `ansi-str 0.8` while `nu-explore` itself was still depending on `0.7`. Single fix necessary to adapt to the new API. cc @zhiburt # User-Facing Changes None --- Cargo.lock | 15 +++------------ crates/nu-explore/Cargo.toml | 2 +- crates/nu-explore/src/views/coloredtextw.rs | 2 +- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 14c6adb0b9..d4f1d7d578 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -107,15 +107,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" -[[package]] -name = "ansi-str" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b1ed1c166829a0ccb5d79caa0f75cb4abd4adb2ce2c096755b7ad5ffdb0990" -dependencies = [ - "ansitok", -] - [[package]] name = "ansi-str" version = "0.8.0" @@ -2868,7 +2859,7 @@ dependencies = [ name = "nu-explore" version = "0.82.1" dependencies = [ - "ansi-str 0.7.2", + "ansi-str", "crossterm", "lscolors", "nu-ansi-term 0.47.0", @@ -3403,7 +3394,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae7891b22598926e4398790c8fe6447930c72a67d36d983a49d6ce682ce83290" dependencies = [ - "ansi-str 0.8.0", + "ansi-str", "ansitok", "bytecount", "fnv", @@ -5068,7 +5059,7 @@ version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce69a5028cd9576063ec1f48edb2c75339fd835e6094ef3e05b3a079bf594a6" dependencies = [ - "ansi-str 0.8.0", + "ansi-str", "ansitok", "papergrid", "unicode-width", diff --git a/crates/nu-explore/Cargo.toml b/crates/nu-explore/Cargo.toml index 9694d8aa8f..b69edd313e 100644 --- a/crates/nu-explore/Cargo.toml +++ b/crates/nu-explore/Cargo.toml @@ -24,5 +24,5 @@ terminal_size = "0.2" strip-ansi-escapes = "0.1" crossterm = "0.26" ratatui = "0.20" -ansi-str = "0.7" +ansi-str = "0.8" lscolors = { version = "0.14", default-features = false, features = ["nu-ansi-term"] } diff --git a/crates/nu-explore/src/views/coloredtextw.rs b/crates/nu-explore/src/views/coloredtextw.rs index 74c17b8635..360fa5cf37 100644 --- a/crates/nu-explore/src/views/coloredtextw.rs +++ b/crates/nu-explore/src/views/coloredtextw.rs @@ -69,7 +69,7 @@ fn cut_string(text: &str, area: Rect, skip: usize) -> Cow<'_, str> { text } -fn style_to_tui(style: ansi_str::Style) -> Style { +fn style_to_tui(style: &ansi_str::Style) -> Style { let mut out = Style::default(); if let Some(clr) = style.background() { out.bg = ansi_color_to_tui_color(clr);