From 42391cb56520382d3dc036fc0db7c0f2b00303d5 Mon Sep 17 00:00:00 2001 From: tottoto Date: Wed, 4 Oct 2023 09:02:19 +0900 Subject: [PATCH] chore(ci): check unused dependencies (#3334) And move itoa to http1 feature --- .github/workflows/CI.yml | 20 ++++++++++++++++++++ Cargo.toml | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 36d1c885db..f83dcc3801 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -25,6 +25,7 @@ jobs: - ffi-header - doc - check-external-types + - udeps steps: - run: exit 0 @@ -232,3 +233,22 @@ jobs: - name: check-external-types run: cargo check-external-types --config .github/workflows/external-types.toml + + udeps: + needs: [style] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@nightly + + - name: Install cargo-udeps + uses: taiki-e/install-action@cargo-udeps + + - name: Check unused dependencies on default features + run: cargo udeps + + - name: Check unused dependencies on full features + run: cargo udeps --features full diff --git a/Cargo.toml b/Cargo.toml index e5820e30de..343948bf04 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,13 +32,13 @@ http-body = "=1.0.0-rc.2" http-body-util = { version = "=0.1.0-rc.3", optional = true } httparse = "1.8" h2_wasi = { version = "0.3.9", optional = true } -itoa = "1" pin-project-lite = "0.2.4" tokio_wasi = { version = "1", features = ["sync"] } # Optional httpdate = { version = "1.0", optional = true } +itoa = { version = "1", optional = true } libc = { version = "0.2", optional = true } wasmedge_wasi_socket = {version = "0.4.2", optional = true } tracing = { version = "0.1", default-features = false, features = ["std"], optional = true } @@ -78,7 +78,7 @@ full = [ ] # HTTP versions -http1 = [] +http1 = ["dep:itoa"] http2 = ["dep:h2_wasi"] # Client/Server