Skip to content

Commit

Permalink
fix: remove unused dependency tracing-attributes
Browse files Browse the repository at this point in the history
Various `quinn*` crates depend on `tracing`. `tracing` in its default feature
set includes `tracing-attributes` in order to expose `#[instrument]` procedural
macro in `tracing::instrument`.

None of `quinn*` make use of the `#[instrument]` macro. Thus the
`tracing-attributes` dependency is unused.

To remove the dependency from the tree, this commit:

1. Restricts `tracing`'s `features` to `std`, effectively removing the
`attributes` feature.
2. Consolidates the various `tracing*` imports across `quinn*` crates into
workspace dependencies.
  • Loading branch information
mxinden committed Jun 20, 2024
1 parent c7a2c40 commit 74bb27f
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ members = ["quinn", "quinn-proto", "quinn-udp", "bench", "perf", "fuzz"]
default-members = ["quinn", "quinn-proto", "quinn-udp", "bench", "perf"]
resolver = "2"

[workspace.dependencies]
tracing = { version = "0.1.10", default-features = false, features = ["std"] }
tracing-subscriber = { version = "0.3.0", default-features = false, features = ["env-filter", "fmt", "ansi", "time", "local-time"] }

[profile.bench]
debug = true

Expand Down
4 changes: 2 additions & 2 deletions bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ rcgen = "0.13"
rustls = { version = "0.23", default-features = false, features = ["ring", "std"] }
clap = { version = "4", features = ["derive"] }
tokio = { version = "1.0.1", features = ["rt", "sync"] }
tracing = "0.1.10"
tracing-subscriber = { version = "0.3.0", default-features = false, features = ["env-filter", "fmt", "ansi", "time", "local-time"] }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
4 changes: 2 additions & 2 deletions perf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ serde_json = { version = "1.0", optional = true }
socket2 = "0.5"
clap = { version = "4", features = ["derive"] }
tokio = { version = "1.0.1", features = ["rt", "macros", "signal", "net", "sync"] }
tracing = "0.1.10"
tracing-subscriber = { version = "0.3.0", default-features = false, features = ["env-filter", "fmt", "ansi", "time", "local-time"] }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
bytes = "1"
4 changes: 2 additions & 2 deletions quinn-proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ rustls-platform-verifier = { version = "0.3", optional = true }
slab = "0.4"
thiserror = "1.0.21"
tinyvec = { version = "1.1", features = ["alloc"] }
tracing = "0.1.10"
tracing = { workspace = true }

[dev-dependencies]
assert_matches = "1.1"
hex-literal = "0.4.0"
rcgen = "0.13"
tracing-subscriber = { version = "0.3.0", default-features = false, features = ["env-filter", "fmt", "ansi", "time", "local-time"] }
tracing-subscriber = { workspace = true }
lazy_static = "1"
2 changes: 1 addition & 1 deletion quinn-udp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ log = ["tracing/log"]
[dependencies]
libc = "0.2.113"
socket2 = "0.5"
tracing = "0.1.10"
tracing = { workspace = true }

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.52.0", features = ["Win32_Foundation", "Win32_System_IO", "Win32_Networking_WinSock"] }
Expand Down
4 changes: 2 additions & 2 deletions quinn/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ proto = { package = "quinn-proto", path = "../quinn-proto", version = "0.11.2",
rustls = { version = "0.23", default-features = false, features = ["ring", "std"], optional = true }
smol = { version = "2", optional = true }
thiserror = "1.0.21"
tracing = "0.1.10"
tracing = { workspace = true }
tokio = { version = "1.28.1", features = ["sync"] }
udp = { package = "quinn-udp", path = "../quinn-udp", version = "0.5", default-features = false }

Expand All @@ -56,7 +56,7 @@ rcgen = "0.13"
rustls-pemfile = "2"
clap = { version = "4", features = ["derive"] }
tokio = { version = "1.28.1", features = ["rt", "rt-multi-thread", "time", "macros", "sync"] }
tracing-subscriber = { version = "0.3.0", default-features = false, features = ["env-filter", "fmt", "ansi", "time", "local-time"] }
tracing-subscriber = { workspace = true }
tracing-futures = { version = "0.2.0", default-features = false, features = ["std-future"] }
url = "2"

Expand Down

0 comments on commit 74bb27f

Please sign in to comment.