Skip to content

Commit e8e059e

Browse files
authored
chore(ci): check unused dependencies (#3334)
And move itoa to http1 feature
1 parent da3fc76 commit e8e059e

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.github/workflows/CI.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- ffi-header
2626
- doc
2727
- check-external-types
28+
- udeps
2829
steps:
2930
- run: exit 0
3031

@@ -232,3 +233,22 @@ jobs:
232233

233234
- name: check-external-types
234235
run: cargo check-external-types --config .github/workflows/external-types.toml
236+
237+
udeps:
238+
needs: [style]
239+
runs-on: ubuntu-latest
240+
steps:
241+
- name: Checkout
242+
uses: actions/checkout@v4
243+
244+
- name: Install Rust
245+
uses: dtolnay/rust-toolchain@nightly
246+
247+
- name: Install cargo-udeps
248+
uses: taiki-e/install-action@cargo-udeps
249+
250+
- name: Check unused dependencies on default features
251+
run: cargo udeps
252+
253+
- name: Check unused dependencies on full features
254+
run: cargo udeps --features full

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ http-body = "=1.0.0-rc.2"
2828
http-body-util = { version = "=0.1.0-rc.3", optional = true }
2929
httparse = "1.8"
3030
h2 = { version = "0.3.9", optional = true }
31-
itoa = "1"
3231
pin-project-lite = "0.2.4"
3332
tokio = { version = "1", features = ["sync"] }
3433

3534
# Optional
3635

3736
httpdate = { version = "1.0", optional = true }
37+
itoa = { version = "1", optional = true }
3838
libc = { version = "0.2", optional = true }
3939
tracing = { version = "0.1", default-features = false, features = ["std"], optional = true }
4040
want = { version = "0.3", optional = true }
@@ -74,7 +74,7 @@ full = [
7474
]
7575

7676
# HTTP versions
77-
http1 = []
77+
http1 = ["dep:itoa"]
7878
http2 = ["dep:h2"]
7979

8080
# Client/Server

0 commit comments

Comments
 (0)