From 109498c1db4154e2388fb500ba61cf76e7f49549 Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Sun, 23 Apr 2023 00:53:21 -0400 Subject: [PATCH] deps: remove const_format dependency (#1114) * deps: remove const_format dependency I was importing it for just one use case, but I could just define the const string manually and not pull it in at all. * update husky entry --- Cargo.lock | 27 --------------------------- Cargo.toml | 7 +------ src/widgets/process_table.rs | 5 ++--- 3 files changed, 3 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4e6e657c..d63d59eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -153,7 +153,6 @@ dependencies = [ "clap_complete", "clap_mangen", "concat-string", - "const_format", "core-foundation", "crossterm", "ctrlc", @@ -292,26 +291,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7439becb5fafc780b6f4de382b1a7a3e70234afe783854a4702ee8adbb838609" -[[package]] -name = "const_format" -version = "0.2.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7309d9b4d3d2c0641e018d449232f2e28f1b22933c137f157d3dbc14228b8c0e" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f47bf7270cf70d370f8f98c1abb6d2d4cf60a6845d30e05bfb90c6568650" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - [[package]] name = "core-foundation" version = "0.9.3" @@ -1393,12 +1372,6 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - [[package]] name = "uom" version = "0.34.0" diff --git a/Cargo.toml b/Cargo.toml index 40f89aba..2ca4cff2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -77,7 +77,6 @@ backtrace = "0.3.67" cfg-if = "1.0.0" clap = { version = "4.2.4", features = ["default", "cargo", "wrap_help"] } concat-string = "1.0.1" -const_format = "0.2.30" crossterm = "0.26.1" ctrlc = { version = "3.2.5", features = ["termination"] } # dhat = "0.3.2" @@ -132,13 +131,9 @@ filedescriptor = "0.8.2" [dev-dependencies] assert_cmd = "2.0.10" +cargo-husky = { version = "1.5.0", default-features = false, features = ["user-hooks"] } predicates = "3.0.2" -[dev-dependencies.cargo-husky] -version = "1.5.0" -default-features = false -features = ["user-hooks"] - [build-dependencies] clap = { version = "4.2.4", features = ["default", "cargo", "wrap_help"] } clap_complete = "4.2.0" diff --git a/src/widgets/process_table.rs b/src/widgets/process_table.rs index 78b5823d..d378d091 100644 --- a/src/widgets/process_table.rs +++ b/src/widgets/process_table.rs @@ -1,6 +1,5 @@ use std::{borrow::Cow, collections::BTreeMap}; -use const_format::formatcp; use hashbrown::{HashMap, HashSet}; use itertools::Itertools; @@ -274,9 +273,9 @@ impl ProcWidgetState { &self, collapsed_pids: &HashSet, data_collection: &DataCollection, ) -> Vec { const BRANCH_END: char = '└'; - const BRANCH_VERTICAL: char = '│'; const BRANCH_SPLIT: char = '├'; const BRANCH_HORIZONTAL: char = '─'; + const SPACED_BRANCH_VERTICAL: &str = "│ "; let search_query = self.get_query(); let is_using_command = self.is_using_command(); @@ -487,7 +486,7 @@ impl ProcWidgetState { prefixes.push(if is_last { " " } else { - formatcp!("{} ", BRANCH_VERTICAL) + SPACED_BRANCH_VERTICAL }); }