Merge pull request #1216 from eladyn/clippy

fix clippy errors
This commit is contained in:
Roderick van Domburg 2023-11-15 20:36:34 +01:00 committed by GitHub
commit 51284d36e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View file

@ -1382,7 +1382,6 @@ impl SpircTask {
// has_shuffle/repeat seem to always be true in these replace msgs, // has_shuffle/repeat seem to always be true in these replace msgs,
// but to replicate the behaviour of the Android client we have to // but to replicate the behaviour of the Android client we have to
// ignore false values. // ignore false values.
let state = state;
if state.repeat() { if state.repeat() {
self.state.set_repeat(true); self.state.set_repeat(true);
} }

View file

@ -392,7 +392,7 @@ impl SpClient {
) -> SpClientResult { ) -> SpClientResult {
let body = protobuf::text_format::print_to_string(message); 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( headers.insert(
CONTENT_TYPE, CONTENT_TYPE,
HeaderValue::from_static("application/x-protobuf"), HeaderValue::from_static("application/x-protobuf"),
@ -409,7 +409,7 @@ impl SpClient {
headers: Option<HeaderMap>, headers: Option<HeaderMap>,
body: Option<&str>, body: Option<&str>,
) -> SpClientResult { ) -> 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")); headers.insert(ACCEPT, HeaderValue::from_static("application/json"));
self.request(method, endpoint, Some(headers), body).await self.request(method, endpoint, Some(headers), body).await