From c1d4a1f136a40240fee742322b00698b4d76fbd1 Mon Sep 17 00:00:00 2001 From: meh Date: Thu, 28 May 2015 20:16:32 +0200 Subject: [PATCH] util/frame/audio: implement DerefMut --- src/util/frame/audio.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/util/frame/audio.rs b/src/util/frame/audio.rs index 620e623..6557aa6 100644 --- a/src/util/frame/audio.rs +++ b/src/util/frame/audio.rs @@ -1,6 +1,6 @@ use libc::c_int; use std::mem; -use std::ops::Deref; +use std::ops::{Deref, DerefMut}; use ffi::*; use ::util::format; @@ -98,11 +98,17 @@ unsafe impl Send for Audio { } impl Deref for Audio { type Target = Frame; - fn deref(&self) -> &Frame { + fn deref(&self) -> &::Target { &self.0 } } +impl DerefMut for Audio { + fn deref_mut(&mut self) -> &mut::Target { + &mut self.0 + } +} + impl Clone for Audio { fn clone(&self) -> Self { Audio(self.0.clone())