mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-29 04:51:09 +00:00
Fix various clippy warnings in gstreamer-video
This commit is contained in:
parent
d99e15aa30
commit
3b66ea66e1
2 changed files with 6 additions and 8 deletions
|
@ -138,11 +138,11 @@ impl VideoFormatInfo {
|
|||
}
|
||||
|
||||
pub fn scale_width(&self, component: u8, width: u32) -> u32 {
|
||||
(-((-(width as i64)) >> self.w_sub()[component as usize])) as u32
|
||||
(-((-(i64::from(width))) >> self.w_sub()[component as usize])) as u32
|
||||
}
|
||||
|
||||
pub fn scale_height(&self, component: u8, height: u32) -> u32 {
|
||||
(-((-(height as i64)) >> self.h_sub()[component as usize])) as u32
|
||||
(-((-(i64::from(height))) >> self.h_sub()[component as usize])) as u32
|
||||
}
|
||||
|
||||
// TODO: pack/unpack
|
||||
|
|
|
@ -242,9 +242,8 @@ impl<'a> VideoInfoBuilder<'a> {
|
|||
return None;
|
||||
}
|
||||
|
||||
for i in 0..((*info.finfo).n_planes as usize) {
|
||||
info.offset[i] = offset[i];
|
||||
}
|
||||
let n_planes = (*info.finfo).n_planes as usize;
|
||||
info.offset[..n_planes].copy_from_slice(&offset[..n_planes]);
|
||||
}
|
||||
|
||||
if let Some(stride) = self.stride {
|
||||
|
@ -252,9 +251,8 @@ impl<'a> VideoInfoBuilder<'a> {
|
|||
return None;
|
||||
}
|
||||
|
||||
for i in 0..((*info.finfo).n_planes as usize) {
|
||||
info.stride[i] = stride[i];
|
||||
}
|
||||
let n_planes = (*info.finfo).n_planes as usize;
|
||||
info.stride[..n_planes].copy_from_slice(&stride[..n_planes]);
|
||||
}
|
||||
|
||||
if let Some(multiview_mode) = self.multiview_mode {
|
||||
|
|
Loading…
Reference in a new issue