codec/video: fix style

This commit is contained in:
meh 2015-08-28 21:28:28 +02:00
parent f223ada727
commit 81badeb10d

View File

@ -63,10 +63,10 @@ impl<'a> Iterator for RateIter<'a> {
fn next(&mut self) -> Option<<Self as Iterator>::Item> { fn next(&mut self) -> Option<<Self as Iterator>::Item> {
unsafe { unsafe {
if !self.ptr.is_null() && (*self.ptr) != 0 { if !self.ptr.is_null() && (*self.ptr) != 0 {
let element = self.ptr; let rate = *self.ptr;
self.ptr = self.ptr.offset(1); self.ptr = self.ptr.offset(1);
Some((*element)) Some(rate)
} }
else { else {
None None
@ -93,10 +93,10 @@ impl<'a> Iterator for FormatIter<'a> {
fn next(&mut self) -> Option<<Self as Iterator>::Item> { fn next(&mut self) -> Option<<Self as Iterator>::Item> {
unsafe { unsafe {
if !self.ptr.is_null() && (*self.ptr) != AVSampleFormat::AV_SAMPLE_FMT_NONE { if !self.ptr.is_null() && (*self.ptr) != AVSampleFormat::AV_SAMPLE_FMT_NONE {
let element = self.ptr; let format = (*self.ptr).into();
self.ptr = self.ptr.offset(1); self.ptr = self.ptr.offset(1);
Some((*element).into()) Some(format)
} }
else { else {
None None
@ -123,10 +123,10 @@ impl<'a> Iterator for ChannelLayoutIter<'a> {
fn next(&mut self) -> Option<<Self as Iterator>::Item> { fn next(&mut self) -> Option<<Self as Iterator>::Item> {
unsafe { unsafe {
if !self.ptr.is_null() && (*self.ptr) != 0 { if !self.ptr.is_null() && (*self.ptr) != 0 {
let element = self.ptr; let chl = ChannelLayout::from_bits_truncate(*self.ptr);
self.ptr = self.ptr.offset(1); self.ptr = self.ptr.offset(1);
Some(ChannelLayout::from_bits_truncate(*element)) Some(chl)
} }
else { else {
None None