From 6e09a92e6b5a5d49f5f64e564ff3a93ca75a8a2e Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Thu, 14 Feb 2019 14:35:00 +0100 Subject: [PATCH] frame: make get_vbuf() work for immutable refs --- nihav-core/src/frame.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nihav-core/src/frame.rs b/nihav-core/src/frame.rs index 3ae8536..253842a 100644 --- a/nihav-core/src/frame.rs +++ b/nihav-core/src/frame.rs @@ -211,45 +211,45 @@ impl NABufferType { _ => None, } } - pub fn get_vbuf(&mut self) -> Option> { + pub fn get_vbuf(&self) -> Option> { match *self { NABufferType::Video(ref vb) => Some(vb.clone()), NABufferType::VideoPacked(ref vb) => Some(vb.clone()), _ => None, } } - pub fn get_vbuf16(&mut self) -> Option> { + pub fn get_vbuf16(&self) -> Option> { match *self { NABufferType::Video16(ref vb) => Some(vb.clone()), _ => None, } } - pub fn get_vbuf32(&mut self) -> Option> { + pub fn get_vbuf32(&self) -> Option> { match *self { NABufferType::Video32(ref vb) => Some(vb.clone()), _ => None, } } - pub fn get_abuf_u8(&mut self) -> Option> { + pub fn get_abuf_u8(&self) -> Option> { match *self { NABufferType::AudioU8(ref ab) => Some(ab.clone()), NABufferType::AudioPacked(ref ab) => Some(ab.clone()), _ => None, } } - pub fn get_abuf_i16(&mut self) -> Option> { + pub fn get_abuf_i16(&self) -> Option> { match *self { NABufferType::AudioI16(ref ab) => Some(ab.clone()), _ => None, } } - pub fn get_abuf_i32(&mut self) -> Option> { + pub fn get_abuf_i32(&self) -> Option> { match *self { NABufferType::AudioI32(ref ab) => Some(ab.clone()), _ => None, } } - pub fn get_abuf_f32(&mut self) -> Option> { + pub fn get_abuf_f32(&self) -> Option> { match *self { NABufferType::AudioF32(ref ab) => Some(ab.clone()), _ => None, -- 2.39.5