From f00bb5a2b832f1de6a3036b50a7b6ba5a8f12cba Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Mon, 15 Dec 2014 10:16:18 +0100 Subject: [PATCH] Update for rustc --- src/lib.rs | 2 +- src/wasapi/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 28df48d..d70806a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,7 +22,7 @@ pub type ChannelsCount = u16; pub struct Buffer<'a>(cpal_impl::Buffer<'a>); /// Format that each sample has. -#[deriving(Clone, Show, PartialEq, Eq)] +#[deriving(Clone, Copy, Show, PartialEq, Eq)] pub enum SampleFormat { /// The value 0 corresponds to 0. I16, diff --git a/src/wasapi/mod.rs b/src/wasapi/mod.rs index 39d8c47..82c647c 100644 --- a/src/wasapi/mod.rs +++ b/src/wasapi/mod.rs @@ -191,7 +191,7 @@ fn init() -> Result { None => &format_attempt, }; - let format_copy = *format; + let format_copy = ptr::read(format); let f = audio_client.lpVtbl.as_ref().unwrap().Initialize; let hresult = f(audio_client, winapi::AUDCLNT_SHAREMODE::AUDCLNT_SHAREMODE_SHARED,