bertptrs / tracing-mutex

A Mutex wrapper tracking acquisition order
https://docs.rs/tracing-mutex/
Apache License 2.0
66 stars 7 forks source link

Make `parking_lot` api consistent so importing from `toml` works seamlessly. #37

Open ewoolsey opened 9 months ago

ewoolsey commented 9 months ago

It would be great if the project structure was identical to parking_lot so that something like this could work without any other configuration.

parking_lot = { version = "0.3", package = "tracing-mutex", features = [
    "parking_lot",
] }
bertptrs commented 9 months ago

Interesting idea. I don't think it can work with the crate as-is because it breaks composability of crate features, but I think it should be possible to create a separate crate (possibly in a workspace?) that implements this.

ewoolsey commented 9 months ago

breaks composability of crate features Ahh you're saying that this would cause conflicts when multiple features are enabled. I see how that could be a problem. Perhaps there is another solution. Maybe it's possible to import this project as normal, and then in the users crate root have something like:

#[cfg(feature = "tracing-mutex")]
pub use tracing_mutex::parking_lot;