From 9007d4932494cc3f9100c9a5665bf177f0fa5b18 Mon Sep 17 00:00:00 2001 From: Nutomic Date: Tue, 31 Oct 2023 11:11:12 +0100 Subject: [PATCH] Remove unused deps (#4111) * Remove unused deps * Adding cargo-machete to woodpecker. --------- Co-authored-by: Dessalines --- .woodpecker.yml | 10 +++++++++ Cargo.lock | 36 -------------------------------- Cargo.toml | 7 ------- crates/api/Cargo.toml | 3 --- crates/api_common/Cargo.toml | 3 +++ crates/api_crud/Cargo.toml | 3 --- crates/db_schema/Cargo.toml | 3 +++ crates/db_views_actor/Cargo.toml | 3 +++ crates/federate/Cargo.toml | 9 -------- crates/routes/Cargo.toml | 1 - crates/utils/Cargo.toml | 2 -- 11 files changed, 19 insertions(+), 61 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index ff4685ac2..57b085bb4 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -65,6 +65,16 @@ steps: # need make existing toolchain available - cargo +nightly fmt -- --check + cargo_machete: + group: format + image: rustlang/rust:nightly + commands: + - wget https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz + - tar -xvf cargo-binstall-x86_64-unknown-linux-musl.tgz + - cp cargo-binstall /usr/local/cargo/bin + - cargo binstall -y cargo-machete + - cargo machete + restore-cache: image: meltwater/drone-cache:v1 pull: true diff --git a/Cargo.lock b/Cargo.lock index 1d9b2a690..83846ebfe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -329,18 +329,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "actix-web-prom" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9df3127d20a5d01c9fc9aceb969a38d31a6767e1b48a54d55a8f56c769a84923" -dependencies = [ - "actix-web", - "futures-core", - "pin-project-lite", - "prometheus", -] - [[package]] name = "addr2line" version = "0.21.0" @@ -2549,7 +2537,6 @@ dependencies = [ "actix-web", "actix-web-httpauth", "anyhow", - "async-trait", "base64 0.21.5", "bcrypt", "captcha", @@ -2561,14 +2548,12 @@ dependencies = [ "lemmy_db_views_actor", "lemmy_db_views_moderator", "lemmy_utils", - "serde", "serial_test", "sitemap-rs", "tokio", "totp-rs", "tracing", "url", - "uuid", "wav", ] @@ -2613,15 +2598,12 @@ version = "0.19.0-rc.3" dependencies = [ "activitypub_federation", "actix-web", - "async-trait", "bcrypt", - "chrono", "lemmy_api_common", "lemmy_db_schema", "lemmy_db_views", "lemmy_db_views_actor", "lemmy_utils", - "serde", "tracing", "url", "uuid", @@ -2756,12 +2738,9 @@ version = "0.19.0-rc.3" dependencies = [ "activitypub_federation", "anyhow", - "async-trait", - "bytes", "chrono", "diesel", "diesel-async", - "enum_delegate", "futures", "lemmy_api_common", "lemmy_apub", @@ -2770,16 +2749,11 @@ dependencies = [ "lemmy_utils", "moka", "once_cell", - "openssl", "reqwest", - "reqwest-middleware", - "reqwest-tracing", - "serde", "serde_json", "tokio", "tokio-util", "tracing", - "tracing-subscriber", ] [[package]] @@ -2801,7 +2775,6 @@ dependencies = [ "reqwest-middleware", "rss", "serde", - "strum", "tokio", "tracing", "url", @@ -2814,15 +2787,12 @@ dependencies = [ "activitypub_federation", "actix-cors", "actix-web", - "actix-web-httpauth", - "actix-web-prom", "chrono", "clap", "clokwerk", "console-subscriber 0.1.10", "diesel", "diesel-async", - "doku", "futures-util", "lemmy_api", "lemmy_api_common", @@ -2839,13 +2809,9 @@ dependencies = [ "reqwest", "reqwest-middleware", "reqwest-tracing", - "rustls 0.21.8", - "serde", "serde_json", "serial_test", "tokio", - "tokio-postgres", - "tokio-postgres-rustls", "tracing", "tracing-actix-web", "tracing-error", @@ -2861,7 +2827,6 @@ version = "0.19.0-rc.3" dependencies = [ "actix-web", "anyhow", - "chrono", "deser-hjson", "diesel", "doku", @@ -2889,7 +2854,6 @@ dependencies = [ "tracing", "tracing-error", "ts-rs", - "typed-builder", "url", "uuid", ] diff --git a/Cargo.toml b/Cargo.toml index ec3be45f9..60e1a544a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -142,7 +142,6 @@ lemmy_federate = { version = "0.19.0-rc.3", path = "crates/federate" } activitypub_federation = { workspace = true } diesel = { workspace = true } diesel-async = { workspace = true } -serde = { workspace = true } actix-web = { workspace = true } tracing = { workspace = true } tracing-actix-web = { workspace = true } @@ -154,7 +153,6 @@ reqwest = { workspace = true } reqwest-middleware = { workspace = true } reqwest-tracing = { workspace = true } clokwerk = { workspace = true } -doku = { workspace = true } serde_json = { workspace = true } tracing-opentelemetry = { workspace = true, optional = true } opentelemetry = { workspace = true, optional = true } @@ -163,13 +161,8 @@ opentelemetry-otlp = { version = "0.12.0", optional = true } pict-rs = { version = "0.4.5", optional = true } tokio.workspace = true actix-cors = "0.6.4" -rustls = { workspace = true } futures-util = { workspace = true } -tokio-postgres = { workspace = true } -tokio-postgres-rustls = { workspace = true } chrono = { workspace = true } prometheus = { version = "0.13.3", features = ["process"] } -actix-web-prom = { version = "0.6.0" } serial_test = { workspace = true } clap = { version = "4.4.7", features = ["derive"] } -actix-web-httpauth = "0.8.1" diff --git a/crates/api/Cargo.toml b/crates/api/Cargo.toml index 758a6c510..bb36bb7e3 100644 --- a/crates/api/Cargo.toml +++ b/crates/api/Cargo.toml @@ -22,11 +22,8 @@ lemmy_db_views_actor = { workspace = true, features = ["full"] } lemmy_api_common = { workspace = true, features = ["full"] } activitypub_federation = { workspace = true } bcrypt = { workspace = true } -serde = { workspace = true } actix-web = { workspace = true } base64 = { workspace = true } -uuid = { workspace = true } -async-trait = { workspace = true } captcha = { workspace = true } anyhow = { workspace = true } tracing = { workspace = true } diff --git a/crates/api_common/Cargo.toml b/crates/api_common/Cargo.toml index a01e6008c..26b32c80b 100644 --- a/crates/api_common/Cargo.toml +++ b/crates/api_common/Cargo.toml @@ -70,6 +70,9 @@ jsonwebtoken = { version = "8.3.0", optional = true } getrandom = { version = "0.2.10", features = ["js"] } enum-map = { workspace = true } +[package.metadata.cargo-machete] +ignored = ["getrandom"] + [dev-dependencies] serial_test = { workspace = true } reqwest-middleware = { workspace = true } diff --git a/crates/api_crud/Cargo.toml b/crates/api_crud/Cargo.toml index 06e29044b..0799332cf 100644 --- a/crates/api_crud/Cargo.toml +++ b/crates/api_crud/Cargo.toml @@ -16,11 +16,8 @@ lemmy_db_views_actor = { workspace = true, features = ["full"] } lemmy_api_common = { workspace = true, features = ["full"] } activitypub_federation = { workspace = true } bcrypt = { workspace = true } -serde = { workspace = true } actix-web = { workspace = true } tracing = { workspace = true } url = { workspace = true } -async-trait = { workspace = true } webmention = "0.5.0" -chrono = { workspace = true } uuid = { workspace = true } diff --git a/crates/db_schema/Cargo.toml b/crates/db_schema/Cargo.toml index 3370a5594..bf1fc0ef2 100644 --- a/crates/db_schema/Cargo.toml +++ b/crates/db_schema/Cargo.toml @@ -76,3 +76,6 @@ uuid = { workspace = true, features = ["v4"] } [dev-dependencies] serial_test = { workspace = true } + +[package.metadata.cargo-machete] +ignored = ["strum"] diff --git a/crates/db_views_actor/Cargo.toml b/crates/db_views_actor/Cargo.toml index 93ce0f5b3..fc3573d46 100644 --- a/crates/db_views_actor/Cargo.toml +++ b/crates/db_views_actor/Cargo.toml @@ -35,3 +35,6 @@ strum_macros = { workspace = true } [dev-dependencies] serial_test = { workspace = true } tokio = { workspace = true } + +[package.metadata.cargo-machete] +ignored = ["strum"] diff --git a/crates/federate/Cargo.toml b/crates/federate/Cargo.toml index 81ad1da4c..c098f9f5b 100644 --- a/crates/federate/Cargo.toml +++ b/crates/federate/Cargo.toml @@ -26,16 +26,7 @@ diesel-async = { workspace = true, features = ["deadpool", "postgres"] } once_cell.workspace = true reqwest.workspace = true serde_json.workspace = true -serde.workspace = true tokio = { workspace = true, features = ["full"] } tracing.workspace = true - -async-trait = "0.1.74" -bytes = "1.5.0" -enum_delegate = "0.2.0" moka = { version = "0.11.3", features = ["future"] } -openssl = "0.10.57" -reqwest-middleware = "0.2.4" -reqwest-tracing = "0.4.6" tokio-util = "0.7.9" -tracing-subscriber = "0.3.17" diff --git a/crates/routes/Cargo.toml b/crates/routes/Cargo.toml index fe8dc7488..12ec75c65 100644 --- a/crates/routes/Cargo.toml +++ b/crates/routes/Cargo.toml @@ -26,7 +26,6 @@ reqwest = { workspace = true, features = ["stream"] } reqwest-middleware = { workspace = true } serde = { workspace = true } url = { workspace = true } -strum = { workspace = true } once_cell = { workspace = true } tracing = { workspace = true } tokio = { workspace = true } diff --git a/crates/utils/Cargo.toml b/crates/utils/Cargo.toml index 5c9598fc4..1e99660c8 100644 --- a/crates/utils/Cargo.toml +++ b/crates/utils/Cargo.toml @@ -18,7 +18,6 @@ full = ["ts-rs"] [dependencies] regex = { workspace = true } -chrono = { workspace = true } tracing = { workspace = true } tracing-error = { workspace = true } itertools = { workspace = true } @@ -37,7 +36,6 @@ http = { workspace = true } doku = { workspace = true, features = ["url-2"] } uuid = { workspace = true, features = ["serde", "v4"] } rosetta-i18n = { workspace = true } -typed-builder = { workspace = true } percent-encoding = { workspace = true } tokio = { workspace = true } openssl = "0.10.57"