From 157011182a1798148beb99f35c8e577eaf78dffb Mon Sep 17 00:00:00 2001 From: Ronald Kinard Date: Sat, 25 Jul 2015 17:08:31 -0500 Subject: [PATCH 1/2] Add box syntax feature annotation. Fixes build. --- src/lib.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index f1b28a6..d0877d6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,6 +47,8 @@ a conversion on your data. If you have the possibility, you should try to match the format of the voice. */ +#![feature(box_syntax)] + pub use samples_formats::{SampleFormat, Sample}; use std::ops::{Deref, DerefMut}; @@ -87,7 +89,7 @@ pub struct Voice(cpal_impl::Voice); /// Number of channels. pub type ChannelsCount = u16; -/// +/// #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct SamplesRate(pub u32); @@ -98,7 +100,7 @@ pub struct SamplesRate(pub u32); #[must_use] pub struct Buffer<'a, T: 'a> where T: Sample { // also contains something, taken by `Drop` - target: Option>, + target: Option>, // if this is non-none, then the data will be written to `conversion.intermediate_buffer` // instead of `target`, and the conversion will be done in buffer's destructor @@ -215,7 +217,7 @@ impl Voice { } else { Buffer { - target: Some(self.0.append_data(max_elements)), + target: Some(self.0.append_data(max_elements)), conversion: None, } } From 6389ab3ece4683c49c1488829a357c0852eb46eb Mon Sep 17 00:00:00 2001 From: Ronald Kinard Date: Sat, 25 Jul 2015 17:13:51 -0500 Subject: [PATCH 2/2] Remove use of box syntax. Allows build on stable/beta rust. --- src/coreaudio/mod.rs | 5 ++--- src/lib.rs | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/coreaudio/mod.rs b/src/coreaudio/mod.rs index abbfa8c..131737d 100644 --- a/src/coreaudio/mod.rs +++ b/src/coreaudio/mod.rs @@ -93,7 +93,7 @@ fn new_voice() -> Result { let (samples_sender, samples_receiver) = channel(); let audio_unit_result = AudioUnit::new(Type::Output, SubType::HalOutput) - .render_callback(box move |channels, num_frames| { + .render_callback(Box::new(move |channels, num_frames| { if let Err(_) = ready_sender.send((channels.len(), num_frames)) { return Err("Callback failed to send 'ready' message.".to_string()); } @@ -114,7 +114,7 @@ fn new_voice() -> Result { } Ok(()) - }) + })) .start(); match audio_unit_result { @@ -130,4 +130,3 @@ fn new_voice() -> Result { } } - diff --git a/src/lib.rs b/src/lib.rs index d0877d6..909044d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,7 +47,6 @@ a conversion on your data. If you have the possibility, you should try to match the format of the voice. */ -#![feature(box_syntax)] pub use samples_formats::{SampleFormat, Sample};