From 3c0d324d01deaa8931b4304fa7e2175461ca084d Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sat, 29 Jan 2022 16:19:15 -0500 Subject: [PATCH] mps-player clippy fix --- mps-player/src/os_controls.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mps-player/src/os_controls.rs b/mps-player/src/os_controls.rs index 8991cd5..bd374ac 100644 --- a/mps-player/src/os_controls.rs +++ b/mps-player/src/os_controls.rs @@ -1,12 +1,12 @@ #[allow(unused_imports)] use std::sync::mpsc::{channel, Receiver, Sender}; -#[cfg(all(target_os = "linux", feature = "os-controls"))] +#[cfg(all(target_os = "linux", feature = "os-controls", feature = "mpris-player"))] use std::thread::JoinHandle; -#[cfg(all(target_os = "linux", feature = "os-controls"))] +#[cfg(all(target_os = "linux", feature = "os-controls", feature = "mpris-player"))] use mpris_player::{Metadata, MprisPlayer, PlaybackStatus}; -#[cfg(all(target_os = "linux", feature = "os-controls"))] +#[cfg(all(target_os = "linux", feature = "os-controls", feature = "mpris-player"))] use mps_interpreter::MpsItem; //use super::MpsController; @@ -14,7 +14,7 @@ use super::player_wrapper::{ControlAction, PlaybackAction}; /// OS-specific APIs for media controls. /// Currently only Linux (dbus) is supported. -#[cfg(all(target_os = "linux", feature = "os-controls"))] +#[cfg(all(target_os = "linux", feature = "os-controls", feature = "mpris-player"))] pub struct SystemControlWrapper { control: Sender, dbus_handle: Option>, //std::sync::Arc, @@ -25,20 +25,20 @@ pub struct SystemControlWrapper { /// OS-specific APIs for media controls. /// Currently only Linux (dbus) is supported. -#[cfg(not(feature = "os-controls"))] +#[cfg(any(not(feature = "os-controls"), not(all(target_os = "linux", feature = "os-controls", feature = "mpris-player"))))] pub struct SystemControlWrapper { #[allow(dead_code)] control: Sender, playback_receiver: Option>, } -#[cfg(all(target_os = "linux", feature = "os-controls"))] +#[cfg(all(target_os = "linux", feature = "os-controls", feature = "mpris-player"))] enum DbusControl { Die, SetMetadata(Metadata), } -#[cfg(all(target_os = "linux", feature = "os-controls"))] +#[cfg(all(target_os = "linux", feature = "os-controls", feature = "mpris-player"))] impl SystemControlWrapper { pub fn new(control: Sender) -> Self { Self { @@ -221,7 +221,7 @@ impl SystemControlWrapper { } } -#[cfg(not(feature = "os-controls"))] +#[cfg(any(not(feature = "os-controls"), not(all(target_os = "linux", feature = "os-controls", feature = "mpris-player"))))] impl SystemControlWrapper { pub fn new(control: Sender) -> Self { Self {