From 60f6451c2eca84db9ba3e2404880f6e012b57bb4 Mon Sep 17 00:00:00 2001 From: eladyn Date: Sat, 11 Nov 2023 20:11:37 +0100 Subject: [PATCH] fix clippy errors --- connect/src/spirc.rs | 1 - core/src/spclient.rs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs index be0a8b80..e7880469 100644 --- a/connect/src/spirc.rs +++ b/connect/src/spirc.rs @@ -1382,7 +1382,6 @@ impl SpircTask { // has_shuffle/repeat seem to always be true in these replace msgs, // but to replicate the behaviour of the Android client we have to // ignore false values. - let state = state; if state.repeat() { self.state.set_repeat(true); } diff --git a/core/src/spclient.rs b/core/src/spclient.rs index d6c5ffb1..fbb8ddc5 100644 --- a/core/src/spclient.rs +++ b/core/src/spclient.rs @@ -392,7 +392,7 @@ impl SpClient { ) -> SpClientResult { let body = protobuf::text_format::print_to_string(message); - let mut headers = headers.unwrap_or_else(HeaderMap::new); + let mut headers = headers.unwrap_or_default(); headers.insert( CONTENT_TYPE, HeaderValue::from_static("application/x-protobuf"), @@ -409,7 +409,7 @@ impl SpClient { headers: Option, body: Option<&str>, ) -> SpClientResult { - let mut headers = headers.unwrap_or_else(HeaderMap::new); + let mut headers = headers.unwrap_or_default(); headers.insert(ACCEPT, HeaderValue::from_static("application/json")); self.request(method, endpoint, Some(headers), body).await