diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs index e7880469..200c3f83 100644 --- a/connect/src/spirc.rs +++ b/connect/src/spirc.rs @@ -1,5 +1,4 @@ use std::{ - convert::TryFrom, future::Future, pin::Pin, sync::atomic::{AtomicUsize, Ordering}, @@ -9,7 +8,7 @@ use std::{ use futures_util::{stream::FusedStream, FutureExt, StreamExt}; -use protobuf::{self, Message}; +use protobuf::Message; use rand::prelude::SliceRandom; use thiserror::Error; use tokio::sync::mpsc; diff --git a/core/src/cdn_url.rs b/core/src/cdn_url.rs index 417a3c73..5a80528e 100644 --- a/core/src/cdn_url.rs +++ b/core/src/cdn_url.rs @@ -1,7 +1,4 @@ -use std::{ - convert::TryFrom, - ops::{Deref, DerefMut}, -}; +use std::ops::{Deref, DerefMut}; use protobuf::Message; use thiserror::Error; diff --git a/core/src/connection/handshake.rs b/core/src/connection/handshake.rs index 9f4f39c0..d18f3df1 100644 --- a/core/src/connection/handshake.rs +++ b/core/src/connection/handshake.rs @@ -2,7 +2,7 @@ use std::{env::consts::ARCH, io}; use byteorder::{BigEndian, ByteOrder, WriteBytesExt}; use hmac::{Hmac, Mac}; -use protobuf::{self, Message}; +use protobuf::Message; use rand::{thread_rng, RngCore}; use rsa::{BigUint, Pkcs1v15Sign, RsaPublicKey}; use sha1::{Digest, Sha1}; diff --git a/core/src/connection/mod.rs b/core/src/connection/mod.rs index e7aa1693..4bac6e3e 100644 --- a/core/src/connection/mod.rs +++ b/core/src/connection/mod.rs @@ -7,7 +7,7 @@ use std::io; use futures_util::{SinkExt, StreamExt}; use num_traits::FromPrimitive; -use protobuf::{self, Message}; +use protobuf::Message; use thiserror::Error; use tokio::net::TcpStream; use tokio_util::codec::Framed; diff --git a/core/src/date.rs b/core/src/date.rs index 5f08d4e8..ddcaf320 100644 --- a/core/src/date.rs +++ b/core/src/date.rs @@ -1,4 +1,4 @@ -use std::{convert::TryFrom, fmt::Debug, ops::Deref}; +use std::{fmt::Debug, ops::Deref}; use time::{ error::ComponentRange, format_description::well_known::Iso8601, Date as _Date, OffsetDateTime, diff --git a/core/src/session.rs b/core/src/session.rs index 69125e17..7801d68b 100755 --- a/core/src/session.rs +++ b/core/src/session.rs @@ -513,13 +513,7 @@ impl Session { } pub fn get_user_attribute(&self, key: &str) -> Option { - self.0 - .data - .read() - .user_data - .attributes - .get(key) - .map(Clone::clone) + self.0.data.read().user_data.attributes.get(key).cloned() } fn weak(&self) -> SessionWeak { diff --git a/core/src/spotify_id.rs b/core/src/spotify_id.rs index 93b0b8f6..9b2d78fd 100644 --- a/core/src/spotify_id.rs +++ b/core/src/spotify_id.rs @@ -1,8 +1,4 @@ -use std::{ - convert::{TryFrom, TryInto}, - fmt, - ops::Deref, -}; +use std::{fmt, ops::Deref}; use thiserror::Error; diff --git a/metadata/src/album.rs b/metadata/src/album.rs index 8b33571e..ede9cc5b 100644 --- a/metadata/src/album.rs +++ b/metadata/src/album.rs @@ -1,5 +1,4 @@ use std::{ - convert::{TryFrom, TryInto}, fmt::Debug, ops::{Deref, DerefMut}, }; diff --git a/metadata/src/artist.rs b/metadata/src/artist.rs index b06b22bc..927846a3 100644 --- a/metadata/src/artist.rs +++ b/metadata/src/artist.rs @@ -1,5 +1,4 @@ use std::{ - convert::{TryFrom, TryInto}, fmt::Debug, ops::{Deref, DerefMut}, }; diff --git a/metadata/src/availability.rs b/metadata/src/availability.rs index 6713da28..7ee84cf1 100644 --- a/metadata/src/availability.rs +++ b/metadata/src/availability.rs @@ -1,5 +1,4 @@ use std::{ - convert::TryFrom, fmt::Debug, ops::{Deref, DerefMut}, }; diff --git a/metadata/src/episode.rs b/metadata/src/episode.rs index 8e200802..dcdde70d 100644 --- a/metadata/src/episode.rs +++ b/metadata/src/episode.rs @@ -1,5 +1,4 @@ use std::{ - convert::{TryFrom, TryInto}, fmt::Debug, ops::{Deref, DerefMut}, }; diff --git a/metadata/src/image.rs b/metadata/src/image.rs index be0137e7..97f1ccb8 100644 --- a/metadata/src/image.rs +++ b/metadata/src/image.rs @@ -1,5 +1,4 @@ use std::{ - convert::{TryFrom, TryInto}, fmt::Debug, ops::{Deref, DerefMut}, }; diff --git a/metadata/src/playlist/annotation.rs b/metadata/src/playlist/annotation.rs index d73f7b93..a21b9804 100644 --- a/metadata/src/playlist/annotation.rs +++ b/metadata/src/playlist/annotation.rs @@ -1,4 +1,3 @@ -use std::convert::TryFrom; use std::fmt::Debug; use protobuf::Message; diff --git a/metadata/src/playlist/attribute.rs b/metadata/src/playlist/attribute.rs index 6da2be83..86a8f6c5 100644 --- a/metadata/src/playlist/attribute.rs +++ b/metadata/src/playlist/attribute.rs @@ -1,6 +1,5 @@ use std::{ collections::HashMap, - convert::TryFrom, fmt::Debug, ops::{Deref, DerefMut}, }; diff --git a/metadata/src/playlist/diff.rs b/metadata/src/playlist/diff.rs index c4967d85..d47578c0 100644 --- a/metadata/src/playlist/diff.rs +++ b/metadata/src/playlist/diff.rs @@ -1,4 +1,4 @@ -use std::{convert::TryFrom, fmt::Debug}; +use std::fmt::Debug; use super::operation::PlaylistOperations; diff --git a/metadata/src/playlist/item.rs b/metadata/src/playlist/item.rs index 4fb892c6..8fa5e4bc 100644 --- a/metadata/src/playlist/item.rs +++ b/metadata/src/playlist/item.rs @@ -1,5 +1,4 @@ use std::{ - convert::{TryFrom, TryInto}, fmt::Debug, ops::{Deref, DerefMut}, }; diff --git a/metadata/src/playlist/list.rs b/metadata/src/playlist/list.rs index b4eaf9b6..b81e61e4 100644 --- a/metadata/src/playlist/list.rs +++ b/metadata/src/playlist/list.rs @@ -1,5 +1,4 @@ use std::{ - convert::{TryFrom, TryInto}, fmt::Debug, ops::{Deref, DerefMut}, }; diff --git a/metadata/src/playlist/operation.rs b/metadata/src/playlist/operation.rs index 5f7c7551..bcdb54b3 100644 --- a/metadata/src/playlist/operation.rs +++ b/metadata/src/playlist/operation.rs @@ -1,5 +1,4 @@ use std::{ - convert::TryFrom, fmt::Debug, ops::{Deref, DerefMut}, }; diff --git a/metadata/src/sale_period.rs b/metadata/src/sale_period.rs index a9ee317c..fa8a1183 100644 --- a/metadata/src/sale_period.rs +++ b/metadata/src/sale_period.rs @@ -1,5 +1,4 @@ use std::{ - convert::TryFrom, fmt::Debug, ops::{Deref, DerefMut}, }; diff --git a/metadata/src/show.rs b/metadata/src/show.rs index 5c86856c..62faa107 100644 --- a/metadata/src/show.rs +++ b/metadata/src/show.rs @@ -1,7 +1,4 @@ -use std::{ - convert::{TryFrom, TryInto}, - fmt::Debug, -}; +use std::fmt::Debug; use crate::{ availability::Availabilities, copyright::Copyrights, episode::Episodes, image::Images, diff --git a/metadata/src/track.rs b/metadata/src/track.rs index dd945bed..131cb1b3 100644 --- a/metadata/src/track.rs +++ b/metadata/src/track.rs @@ -1,5 +1,4 @@ use std::{ - convert::{TryFrom, TryInto}, fmt::Debug, ops::{Deref, DerefMut}, }; diff --git a/playback/src/audio_backend/pipe.rs b/playback/src/audio_backend/pipe.rs index e0e8a77c..e680256d 100644 --- a/playback/src/audio_backend/pipe.rs +++ b/playback/src/audio_backend/pipe.rs @@ -66,6 +66,7 @@ impl Sink for StdoutSink { OpenOptions::new() .write(true) .create(true) + .truncate(true) .open(file) .map_err(|e| StdoutError::OpenFailure { file: file.to_string(),