From 7be55c96ec36f944bb7dc0799b6697c874d59498 Mon Sep 17 00:00:00 2001 From: Felix Prillwitz Date: Wed, 20 Nov 2024 00:21:16 +0100 Subject: [PATCH] connect: fix 1.75 problems --- connect/src/model.rs | 4 ++-- connect/src/state/context.rs | 11 ++++++----- core/src/spclient.rs | 2 ++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/connect/src/model.rs b/connect/src/model.rs index 80923cb8b..fb89d378f 100644 --- a/connect/src/model.rs +++ b/connect/src/model.rs @@ -37,9 +37,9 @@ impl ResolveContext { // expected page_url: hm://artistplaycontext/v1/page/spotify/album/5LFzwirfFwBKXJQGfwmiMY/km_artist pub fn from_page_url(page_url: String) -> Self { let split = if let Some(rest) = page_url.strip_prefix("hm://") { - rest.split("/") + rest.split('/') } else { - page_url.split("/") + page_url.split('/') }; let uri = split diff --git a/connect/src/state/context.rs b/connect/src/state/context.rs index ff1325da7..a32cc98b5 100644 --- a/connect/src/state/context.rs +++ b/connect/src/state/context.rs @@ -216,24 +216,25 @@ impl ConnectState { ) -> Result { let question_mark_idx = ctx_track .uri - .contains("?") + .contains('?') .then(|| ctx_track.uri.find('?')) .flatten(); let ctx_track_uri = if let Some(idx) = question_mark_idx { - &ctx_track.uri[..idx].to_string() + &ctx_track.uri[..idx] } else { &ctx_track.uri - }; + } + .to_string(); - let provider = if self.unavailable_uri.contains(ctx_track_uri) { + let provider = if self.unavailable_uri.contains(&ctx_track_uri) { Provider::Unavailable } else { provider.unwrap_or(Provider::Context) }; let id = if !ctx_track_uri.is_empty() { - SpotifyId::from_uri(ctx_track_uri) + SpotifyId::from_uri(&ctx_track_uri) } else if !ctx_track.gid.is_empty() { SpotifyId::from_raw(&ctx_track.gid) } else { diff --git a/core/src/spclient.rs b/core/src/spclient.rs index 8abccbe8a..fe78b282a 100644 --- a/core/src/spclient.rs +++ b/core/src/spclient.rs @@ -48,7 +48,9 @@ component! { pub type SpClientResult = Result; +#[allow(clippy::declare_interior_mutable_const)] pub const CLIENT_TOKEN: HeaderName = HeaderName::from_static("client-token"); +#[allow(clippy::declare_interior_mutable_const)] const CONNECTION_ID: HeaderName = HeaderName::from_static("x-spotify-connection-id"); #[derive(Debug, Error)]