Skip to content

Commit fbd3a5e

Browse files
committed
refactor: replace SampleRate newtype with type alias
1 parent 70a7f5a commit fbd3a5e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

asio-sys/examples/enumerate.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ pub enum SampleFormat {
2323
pub type ChannelCount = u16;
2424

2525
// The number of samples processed per second for a single channel of audio.
26-
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
27-
pub struct SampleRate(pub u32);
26+
pub type SampleRate = u32;
2827

2928
#[derive(Debug, Clone, PartialEq, Eq)]
3029
pub struct Format {
@@ -46,12 +45,12 @@ fn main() {
4645
.expect("failed to retrieve sample rate");
4746
let in_fmt = Format {
4847
channels: channels.ins as _,
49-
sample_rate: SampleRate(sample_rate as _),
48+
sample_rate: sample_rate as _,
5049
data_type: SampleFormat::F32,
5150
};
5251
let out_fmt = Format {
5352
channels: channels.outs as _,
54-
sample_rate: SampleRate(sample_rate as _),
53+
sample_rate: sample_rate as _,
5554
data_type: SampleFormat::F32,
5655
};
5756
println!(" Input {:?}", in_fmt);

0 commit comments

Comments
 (0)