How to require/build dependencies for the specific feature enabled only?
⚓ Rust 📅 2025-09-12 👤 surdeus 👁️ 11I have following shared dependencies,
but not all of them are really wanted if only A or B is active:
[features]
# default = ["a"]
a = []
b = []
[dependencies]
# for A feature enabled only?
chrono = { version = "0.4.41", features = ["serde"] }
librqbit-core = "5.0.0"
# for B feature enabled only?
log = "0.4.28"
regex = "1.11.2"
How to skip B requirement if I'm using only A for this library?
3 posts - 2 participants
🏷️ Rust_feed