From 80c41841a9a8e9f1b5dee31956e2e9efa97c74e5 Mon Sep 17 00:00:00 2001 From: Andrew Aylett Date: Tue, 7 Jan 2025 20:04:48 +0000 Subject: [PATCH] chore: Remove unneeded dependencies (#2523) These dependencies are unused in actual code, and the test I've removed is a remnant from a move to use an external library -- it was useful to show that the mechanical transformation was correct, but it's only testing that library nowadays. --- Cargo.lock | 53 ------------------------- crates/atuin-common/Cargo.toml | 1 - crates/atuin-common/src/utils.rs | 20 ---------- crates/atuin-history/Cargo.toml | 20 ---------- crates/atuin-server-database/Cargo.toml | 3 +- crates/atuin-server-postgres/Cargo.toml | 2 +- crates/atuin-server/Cargo.toml | 5 +-- crates/atuin/Cargo.toml | 5 --- 8 files changed, 3 insertions(+), 106 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f94713845a3..bc311e7dae6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -231,14 +231,11 @@ dependencies = [ "atuin-history", "atuin-server", "atuin-server-postgres", - "base64 0.22.1", "clap", "clap_complete", "clap_complete_nushell", "colored", "crossterm", - "directories", - "env_logger", "eyre", "fs-err", "futures-util", @@ -262,10 +259,8 @@ dependencies = [ "tracing", "tracing-subscriber", "tracing-tree", - "unicode-segmentation", "unicode-width 0.1.14", "uuid", - "whoami", ] [[package]] @@ -333,7 +328,6 @@ dependencies = [ "getrandom", "lazy_static", "pretty_assertions", - "rand", "semver", "serde", "sqlx", @@ -389,33 +383,13 @@ dependencies = [ name = "atuin-history" version = "18.4.0" dependencies = [ - "async-trait", "atuin-client", - "atuin-common", - "base64 0.22.1", "crossterm", - "directories", "divan", - "eyre", - "fs-err", - "futures-util", - "indicatif", - "interim", - "itertools", - "log", "rand", - "semver", "serde", - "serde_json", - "sysinfo", "time", - "tokio", - "tracing", - "tracing-tree", "unicode-segmentation", - "unicode-width 0.1.14", - "uuid", - "whoami", ] [[package]] @@ -428,7 +402,6 @@ dependencies = [ "atuin-server-database", "axum", "axum-server", - "base64 0.22.1", "config", "eyre", "fs-err", @@ -438,7 +411,6 @@ dependencies = [ "rand", "reqwest 0.11.27", "rustls 0.23.20", - "rustls-pemfile 2.2.0", "semver", "serde", "serde_json", @@ -447,7 +419,6 @@ dependencies = [ "tower 0.4.13", "tower-http", "tracing", - "uuid", ] [[package]] @@ -460,7 +431,6 @@ dependencies = [ "serde", "time", "tracing", - "uuid", ] [[package]] @@ -1327,29 +1297,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "env_filter" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" -dependencies = [ - "log", - "regex", -] - -[[package]] -name = "env_logger" -version = "0.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" -dependencies = [ - "anstream", - "anstyle", - "env_filter", - "humantime", - "log", -] - [[package]] name = "equivalent" version = "1.0.1" diff --git a/crates/atuin-common/Cargo.toml b/crates/atuin-common/Cargo.toml index f89c1d06b6a..af255eadc2e 100644 --- a/crates/atuin-common/Cargo.toml +++ b/crates/atuin-common/Cargo.toml @@ -16,7 +16,6 @@ repository = { workspace = true } time = { workspace = true } serde = { workspace = true } uuid = { workspace = true } -rand = { workspace = true } typed-builder = { workspace = true } eyre = { workspace = true } sqlx = { workspace = true } diff --git a/crates/atuin-common/src/utils.rs b/crates/atuin-common/src/utils.rs index 869866b0b80..7f156d77ef1 100644 --- a/crates/atuin-common/src/utils.rs +++ b/crates/atuin-common/src/utils.rs @@ -192,7 +192,6 @@ impl> Escapable for T {} #[cfg(test)] mod tests { use pretty_assertions::assert_ne; - use time::Month; use super::*; use std::env; @@ -242,25 +241,6 @@ mod tests { env::remove_var("HOME"); } - #[test] - fn days_from_month() { - assert_eq!(time::util::days_in_year_month(2023, Month::January), 31); - assert_eq!(time::util::days_in_year_month(2023, Month::February), 28); - assert_eq!(time::util::days_in_year_month(2023, Month::March), 31); - assert_eq!(time::util::days_in_year_month(2023, Month::April), 30); - assert_eq!(time::util::days_in_year_month(2023, Month::May), 31); - assert_eq!(time::util::days_in_year_month(2023, Month::June), 30); - assert_eq!(time::util::days_in_year_month(2023, Month::July), 31); - assert_eq!(time::util::days_in_year_month(2023, Month::August), 31); - assert_eq!(time::util::days_in_year_month(2023, Month::September), 30); - assert_eq!(time::util::days_in_year_month(2023, Month::October), 31); - assert_eq!(time::util::days_in_year_month(2023, Month::November), 30); - assert_eq!(time::util::days_in_year_month(2023, Month::December), 31); - - // leap years - assert_eq!(time::util::days_in_year_month(2024, Month::February), 29); - } - #[test] fn uuid_is_unique() { let how_many: usize = 1000000; diff --git a/crates/atuin-history/Cargo.toml b/crates/atuin-history/Cargo.toml index 305323a8837..925f6e14a61 100644 --- a/crates/atuin-history/Cargo.toml +++ b/crates/atuin-history/Cargo.toml @@ -15,33 +15,13 @@ readme.workspace = true [dependencies] atuin-client = { path = "../atuin-client", version = "18.4.0" } -atuin-common = { path = "../atuin-common", version = "18.4.0" } -log = { workspace = true } time = { workspace = true } -eyre = { workspace = true } -directories = { workspace = true } -indicatif = "0.17.5" serde = { workspace = true } -serde_json = { workspace = true } crossterm = { version = "0.28.1", features = ["use-dev-tty"] } -unicode-width = "0.1" -itertools = { workspace = true } -tokio = { workspace = true } -async-trait = { workspace = true } -interim = { workspace = true } -base64 = { workspace = true } -fs-err = { workspace = true } -whoami = { workspace = true } -semver = { workspace = true } -futures-util = "0.3" -tracing = "0.1" -uuid = { workspace = true } unicode-segmentation = "1.11.0" -sysinfo = "0.30.7" [dev-dependencies] -tracing-tree = "0.4" divan = "0.1.14" rand = { workspace = true } diff --git a/crates/atuin-server-database/Cargo.toml b/crates/atuin-server-database/Cargo.toml index ce7be503296..3aca9eaba78 100644 --- a/crates/atuin-server-database/Cargo.toml +++ b/crates/atuin-server-database/Cargo.toml @@ -12,9 +12,8 @@ repository = { workspace = true } [dependencies] atuin-common = { path = "../atuin-common", version = "18.4.0" } -tracing = "0.1" +tracing = { workspace = true } time = { workspace = true } eyre = { workspace = true } -uuid = { workspace = true } serde = { workspace = true } async-trait = { workspace = true } diff --git a/crates/atuin-server-postgres/Cargo.toml b/crates/atuin-server-postgres/Cargo.toml index d6fcb15aa2c..8fe59d390e0 100644 --- a/crates/atuin-server-postgres/Cargo.toml +++ b/crates/atuin-server-postgres/Cargo.toml @@ -14,7 +14,7 @@ atuin-common = { path = "../atuin-common", version = "18.4.0" } atuin-server-database = { path = "../atuin-server-database", version = "18.4.0" } eyre = { workspace = true } -tracing = "0.1" +tracing = { workspace = true } time = { workspace = true } serde = { workspace = true } sqlx = { workspace = true } diff --git a/crates/atuin-server/Cargo.toml b/crates/atuin-server/Cargo.toml index 02c36b7f2c6..8de87f2f11a 100644 --- a/crates/atuin-server/Cargo.toml +++ b/crates/atuin-server/Cargo.toml @@ -14,14 +14,12 @@ repository = { workspace = true } atuin-common = { path = "../atuin-common", version = "18.4.0" } atuin-server-database = { path = "../atuin-server-database", version = "18.4.0" } -tracing = "0.1" +tracing = { workspace = true } time = { workspace = true } eyre = { workspace = true } -uuid = { workspace = true } config = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -base64 = { workspace = true } rand = { workspace = true } tokio = { workspace = true } async-trait = { workspace = true } @@ -32,7 +30,6 @@ tower = { workspace = true } tower-http = { version = "0.5", features = ["trace"] } reqwest = { workspace = true } rustls = { version = "0.23", features = ["ring"], default-features = false } -rustls-pemfile = "2.1" argon2 = "0.5" semver = { workspace = true } metrics-exporter-prometheus = "0.12.1" diff --git a/crates/atuin/Cargo.toml b/crates/atuin/Cargo.toml index a43bf563d7f..0dcf135a233 100644 --- a/crates/atuin/Cargo.toml +++ b/crates/atuin/Cargo.toml @@ -51,10 +51,8 @@ atuin-history = { path = "../atuin-history", version = "18.4.0" } atuin-daemon = { path = "../atuin-daemon", version = "18.4.0", optional = true, default-features = false } log = { workspace = true } -env_logger = "0.11.5" time = { workspace = true } eyre = { workspace = true } -directories = { workspace = true } indicatif = "0.17.5" serde = { workspace = true } serde_json = { workspace = true } @@ -64,12 +62,10 @@ itertools = { workspace = true } tokio = { workspace = true } async-trait = { workspace = true } interim = { workspace = true } -base64 = { workspace = true } clap = { workspace = true } clap_complete = "4.5.8" clap_complete_nushell = "4.5.4" fs-err = { workspace = true } -whoami = { workspace = true } rpassword = "7.0" semver = { workspace = true } rustix = { workspace = true } @@ -82,7 +78,6 @@ ratatui = "0.29.0" tracing = "0.1" tracing-subscriber = { workspace = true } uuid = { workspace = true } -unicode-segmentation = "1.11.0" sysinfo = "0.30.7" regex = "1.10.5"