Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some Edition 2021 warnings/errors #691

Merged
merged 2 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/host/alsa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
24 changes: 12 additions & 12 deletions src/host/asio/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ pub type SupportedOutputConfigs = std::vec::IntoIter<SupportedStreamConfigRange>

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 {
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down