mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Merge pull request #897 from JasonLG1979/clippy-lints
Address clippy lint warnings from Rust 1.57
This commit is contained in:
commit
7160dc1017
6 changed files with 9 additions and 9 deletions
|
@ -46,6 +46,7 @@ pub struct TrackContext {
|
||||||
// pub metadata: MetadataContext,
|
// pub metadata: MetadataContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Deserialize, Debug)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct ArtistContext {
|
pub struct ArtistContext {
|
||||||
|
@ -54,6 +55,7 @@ pub struct ArtistContext {
|
||||||
image_uri: String,
|
image_uri: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Deserialize, Debug)]
|
||||||
pub struct MetadataContext {
|
pub struct MetadataContext {
|
||||||
album_title: String,
|
album_title: String,
|
||||||
|
|
|
@ -87,8 +87,7 @@ impl Decoder for ApCodec {
|
||||||
|
|
||||||
let mut payload = buf.split_to(size + MAC_SIZE);
|
let mut payload = buf.split_to(size + MAC_SIZE);
|
||||||
|
|
||||||
self.decode_cipher
|
self.decode_cipher.decrypt(payload.get_mut(..size).unwrap());
|
||||||
.decrypt(&mut payload.get_mut(..size).unwrap());
|
|
||||||
let mac = payload.split_off(size);
|
let mac = payload.split_off(size);
|
||||||
self.decode_cipher.check_mac(mac.as_ref())?;
|
self.decode_cipher.check_mac(mac.as_ref())?;
|
||||||
|
|
||||||
|
|
|
@ -24,15 +24,12 @@ pub struct JackData {
|
||||||
impl ProcessHandler for JackData {
|
impl ProcessHandler for JackData {
|
||||||
fn process(&mut self, _: &Client, ps: &ProcessScope) -> Control {
|
fn process(&mut self, _: &Client, ps: &ProcessScope) -> Control {
|
||||||
// get output port buffers
|
// get output port buffers
|
||||||
let mut out_r = self.port_r.as_mut_slice(ps);
|
let buf_r: &mut [f32] = self.port_r.as_mut_slice(ps);
|
||||||
let mut out_l = self.port_l.as_mut_slice(ps);
|
let buf_l: &mut [f32] = self.port_l.as_mut_slice(ps);
|
||||||
let buf_r: &mut [f32] = &mut out_r;
|
|
||||||
let buf_l: &mut [f32] = &mut out_l;
|
|
||||||
// get queue iterator
|
// get queue iterator
|
||||||
let mut queue_iter = self.rec.try_iter();
|
let mut queue_iter = self.rec.try_iter();
|
||||||
|
|
||||||
let buf_size = buf_r.len();
|
for i in 0..buf_r.len() {
|
||||||
for i in 0..buf_size {
|
|
||||||
buf_r[i] = queue_iter.next().unwrap_or(0.0);
|
buf_r[i] = queue_iter.next().unwrap_or(0.0);
|
||||||
buf_l[i] = queue_iter.next().unwrap_or(0.0);
|
buf_l[i] = queue_iter.next().unwrap_or(0.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ use self::gstreamer::GstreamerSink;
|
||||||
|
|
||||||
#[cfg(any(feature = "rodio-backend", feature = "rodiojack-backend"))]
|
#[cfg(any(feature = "rodio-backend", feature = "rodiojack-backend"))]
|
||||||
mod rodio;
|
mod rodio;
|
||||||
#[cfg(any(feature = "rodio-backend", feature = "rodiojack-backend"))]
|
#[cfg(feature = "rodio-backend")]
|
||||||
use self::rodio::RodioSink;
|
use self::rodio::RodioSink;
|
||||||
|
|
||||||
#[cfg(feature = "sdl-backend")]
|
#[cfg(feature = "sdl-backend")]
|
||||||
|
|
|
@ -227,5 +227,6 @@ impl Sink for RodioSink {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RodioSink {
|
impl RodioSink {
|
||||||
|
#[allow(dead_code)]
|
||||||
pub const NAME: &'static str = "rodio";
|
pub const NAME: &'static str = "rodio";
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ use alsa::{Ctl, Round};
|
||||||
use std::ffi::CString;
|
use std::ffi::CString;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct AlsaMixer {
|
pub struct AlsaMixer {
|
||||||
config: MixerConfig,
|
config: MixerConfig,
|
||||||
min: i64,
|
min: i64,
|
||||||
|
|
Loading…
Reference in a new issue