Skip to content

Commit b01631a

Browse files
authored
refactor(subscriber): use dep syntax to avoid crate rename (#573)
Use the `dep:` syntax to explicitly define `parking_lot` as dependency in the feature definition, added in Rust 1.60. This allows to avoid the rename of `parking_lot` to `parking_lot_crate` internally.
1 parent a6cf14b commit b01631a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

console-subscriber/Cargo.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ keywords = [
2626

2727
[features]
2828
default = ["env-filter"]
29-
parking_lot = ["parking_lot_crate", "tracing-subscriber/parking_lot"]
29+
parking_lot = ["dep:parking_lot", "tracing-subscriber/parking_lot"]
3030
env-filter = ["tracing-subscriber/env-filter"]
31-
grpc-web = ["tonic-web"]
31+
grpc-web = ["dep:tonic-web"]
3232

3333
[dependencies]
3434
crossbeam-utils = "0.8.7"
@@ -42,9 +42,7 @@ tracing = "0.1.26"
4242
tracing-subscriber = { version = "0.3.17", default-features = false, features = ["fmt", "registry"] }
4343
futures-task = { version = "0.3", default-features = false }
4444
hdrhistogram = { version = "7.3.0", default-features = false, features = ["serialization"] }
45-
# The parking_lot dependency is renamed, because we want our `parking_lot`
46-
# feature to also enable `tracing-subscriber`'s parking_lot feature flag.
47-
parking_lot_crate = { package = "parking_lot", version = "0.12", optional = true }
45+
parking_lot = { version = "0.12", optional = true }
4846
humantime = "2.1.0"
4947
prost = "0.12"
5048
prost-types = "0.12.0"

console-subscriber/src/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![allow(dead_code, unused_imports)]
33

44
#[cfg(feature = "parking_lot")]
5-
pub(crate) use parking_lot_crate::{Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};
5+
pub(crate) use parking_lot::{Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};
66

77
#[cfg(not(feature = "parking_lot"))]
88
pub(crate) use self::std_impl::*;

0 commit comments

Comments
 (0)