From 9d80521e09bf2daaf7f34d2d4c3c6f9b9dbd84b6 Mon Sep 17 00:00:00 2001 From: Roderick van Domburg Date: Mon, 22 Aug 2022 22:38:19 +0200 Subject: [PATCH] Fix warning and clippy lints --- core/src/spotify_id.rs | 4 ++-- playback/src/config.rs | 4 ++-- playback/src/decoder/symphonia_decoder.rs | 2 +- playback/src/player.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/spotify_id.rs b/core/src/spotify_id.rs index f1c1f1b8..3e913ce1 100644 --- a/core/src/spotify_id.rs +++ b/core/src/spotify_id.rs @@ -87,10 +87,10 @@ impl SpotifyId { /// Returns whether this `SpotifyId` is for a playable audio item, if known. pub fn is_playable(&self) -> bool { - return matches!( + matches!( self.item_type, SpotifyItemType::Episode | SpotifyItemType::Track - ); + ) } /// Parses a base16 (hex) encoded [Spotify ID] into a `SpotifyId`. diff --git a/playback/src/config.rs b/playback/src/config.rs index f1276adb..cdb455ce 100644 --- a/playback/src/config.rs +++ b/playback/src/config.rs @@ -73,7 +73,7 @@ impl AudioFormat { } } -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum NormalisationType { Album, Track, @@ -98,7 +98,7 @@ impl Default for NormalisationType { } } -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum NormalisationMethod { Basic, Dynamic, diff --git a/playback/src/decoder/symphonia_decoder.rs b/playback/src/decoder/symphonia_decoder.rs index 08c7b37c..b0d47acd 100644 --- a/playback/src/decoder/symphonia_decoder.rs +++ b/playback/src/decoder/symphonia_decoder.rs @@ -144,7 +144,7 @@ impl SymphoniaDecoder { (time.seconds as f64 + time.frac) * 1000. } // Fallback in the unexpected case that the format has no base time set. - None => (ts as f64 * PAGES_PER_MS), + None => ts as f64 * PAGES_PER_MS, }; seeked_to_ms as u32 } diff --git a/playback/src/player.rs b/playback/src/player.rs index 30d6d2a2..a7a51762 100644 --- a/playback/src/player.rs +++ b/playback/src/player.rs @@ -61,7 +61,7 @@ pub struct Player { play_request_id_generator: SeqGenerator, } -#[derive(PartialEq, Debug, Clone, Copy)] +#[derive(PartialEq, Eq, Debug, Clone, Copy)] pub enum SinkStatus { Running, Closed,