Sinono3 / souvlaki

A cross-platform library for handling OS media controls and metadata.
MIT License
80 stars 15 forks source link

Add MSRV (Minimal Supported Rust Version) #46

Closed hasezoey closed 9 months ago

hasezoey commented 9 months ago

Currently this package does not have a mentioned MSRV, neither in the README, rust-toolchain file or Cargo.toml.

Why? because upgrading to 0.7 has lead to the following error for rust versions below 1.74(.1):

error[E0446]: private type `ServiceState` in public interface
  --> /home/hasezoey/.local/cargo/registry/src/index.crates.io-6f17d22bba15001f/souvlaki-0.7.0/src/platform/mpris/dbus/interfaces.rs:19:1
   |
19 | / pub fn register_methods<F>(
20 | |     state: &Arc<Mutex<ServiceState>>,
21 | |     event_handler: &Arc<Mutex<F>>,
22 | |     friendly_name: String,
...  |
25 | | where
26 | |     F: Fn(MediaControlEvent) + Send + 'static,
   | |______________________________________________^ can't leak private type
   |
  ::: /home/hasezoey/.local/cargo/registry/src/index.crates.io-6f17d22bba15001f/souvlaki-0.7.0/src/platform/mpris/dbus/mod.rs:54:1
   |
54 |   struct ServiceState {
   |   ------------------- `ServiceState` declared as private

For more information about this error, try `rustc --explain E0446`.

suggestions:

LucasFA commented 9 months ago

Given that the MSRV is so recent, there's also no reason not to raise the edition to 2021. Not that it makes any difference, really

Sinono3 commented 9 months ago

Thank you. This is completely necessary and I apologize for any trouble the lack of it caused. I can set the MSRV to 1.74 but I feel like the error about leaking a private type should have an easy solution that lowers the MSRV again since we're not using any particularly cutting-edge features. I'll try something out.

Sinono3 commented 9 months ago

In the end I managed to get the MSRV down to 1.67. I'll keep the edition 2018 for now. Thanks!

EDIT: To actually fix the error I just moved around some modules. It's not that good of a solution but after all in 0.8 the dbus backend won't be supported anymore.

LucasFA commented 9 months ago

That's great, thank you!

hasezoey commented 9 months ago

It's not that good of a solution but after all in 0.8 the dbus backend won't be supported anymore.

just to confirm some wording, this only means that the dbus(crate) backend wont be supported anymore, but dbus as a whole will still be supported (via zbus), right?

Sinono3 commented 9 months ago

Exactly.