From 08acedd677701b7b0e219681a9819851a933b40e Mon Sep 17 00:00:00 2001 From: Kai Giebeler Date: Tue, 20 Sep 2022 21:47:35 +0200 Subject: [PATCH 1/2] fix towards edition 2021 --- src/host/asio/device.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/host/asio/device.rs b/src/host/asio/device.rs index cb8feb3..b4659b0 100644 --- a/src/host/asio/device.rs +++ b/src/host/asio/device.rs @@ -4,18 +4,18 @@ pub type SupportedOutputConfigs = std::vec::IntoIter use super::parking_lot::Mutex; use super::sys; +use crate::BackendSpecificError; +use crate::DefaultStreamConfigError; +use crate::DeviceNameError; +use crate::DevicesError; +use crate::SampleFormat; +use crate::SampleRate; +use crate::SupportedBufferSize; +use crate::SupportedStreamConfig; +use crate::SupportedStreamConfigRange; +use crate::SupportedStreamConfigsError; use std::hash::{Hash, Hasher}; use std::sync::Arc; -use BackendSpecificError; -use DefaultStreamConfigError; -use DeviceNameError; -use DevicesError; -use SampleFormat; -use SampleRate; -use SupportedBufferSize; -use SupportedStreamConfig; -use SupportedStreamConfigRange; -use SupportedStreamConfigsError; /// A ASIO Device pub struct Device { @@ -68,7 +68,7 @@ impl Device { // Collect a config for every combination of supported sample rate and number of channels. let mut supported_configs = vec![]; - for &rate in ::COMMON_SAMPLE_RATES { + for &rate in crate::COMMON_SAMPLE_RATES { if !self .driver .can_sample_rate(rate.0.into()) @@ -105,7 +105,7 @@ impl Device { // Collect a config for every combination of supported sample rate and number of channels. let mut supported_configs = vec![]; - for &rate in ::COMMON_SAMPLE_RATES { + for &rate in crate::COMMON_SAMPLE_RATES { if !self .driver .can_sample_rate(rate.0.into()) From e78a8472723951694f7abf607c54be671edeecd4 Mon Sep 17 00:00:00 2001 From: Kai Giebeler Date: Tue, 20 Sep 2022 21:51:20 +0200 Subject: [PATCH 2/2] fix some clippy warnings --- src/host/alsa/mod.rs | 4 ++-- src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/host/alsa/mod.rs b/src/host/alsa/mod.rs index c345c6d..fa6f921 100644 --- a/src/host/alsa/mod.rs +++ b/src/host/alsa/mod.rs @@ -892,7 +892,7 @@ impl Stream { let thread = thread::Builder::new() .name("cpal_alsa_in".to_owned()) .spawn(move || { - input_stream_worker(rx, &*stream, &mut data_callback, &mut error_callback); + input_stream_worker(rx, &stream, &mut data_callback, &mut error_callback); }) .unwrap(); Stream { @@ -917,7 +917,7 @@ impl Stream { let thread = thread::Builder::new() .name("cpal_alsa_out".to_owned()) .spawn(move || { - output_stream_worker(rx, &*stream, &mut data_callback, &mut error_callback); + output_stream_worker(rx, &stream, &mut data_callback, &mut error_callback); }) .unwrap(); Stream { diff --git a/src/lib.rs b/src/lib.rs index 3a6a1e6..98da3e0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -319,13 +319,13 @@ pub struct OutputStreamTimestamp { } /// Information relevant to a single call to the user's input stream data callback. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct InputCallbackInfo { timestamp: InputStreamTimestamp, } /// Information relevant to a single call to the user's output stream data callback. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct OutputCallbackInfo { timestamp: OutputStreamTimestamp, }