Fix some new clippy 1.86 warnings

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1696>
This commit is contained in:
Sebastian Dröge 2025-04-04 11:16:22 +03:00 committed by GStreamer Marge Bot
parent 736afc5ac3
commit 161f2bca0a
3 changed files with 4 additions and 5 deletions

View file

@ -880,7 +880,7 @@ impl VideoInfo {
#[inline]
pub fn field_height(&self) -> u32 {
if self.0.interlace_mode == ffi::GST_VIDEO_INTERLACE_MODE_ALTERNATE {
(self.0.height as u32 + 1) / 2
(self.0.height as u32).div_ceil(2)
} else {
self.0.height as u32
}

View file

@ -24,11 +24,10 @@ pub(super) fn line_buffer_len(format: VideoFormat, width: u32) -> usize {
skip_assert_initialized!();
// Taken from gst-plugins-base/gst-libs/gst/video/video-info.c:fill_planes
match format {
VideoFormat::V210 => ((width as usize + 47) / 48) * 128,
VideoFormat::V210 => (width as usize).div_ceil(48) * 128,
VideoFormat::Uyvy => {
// round up width to the next multiple of 4
// FIXME: {integer}::next_multiple_of was stabilised in rustc 1.73.0
((width as usize * 2) + 3) & !3
(width as usize * 2).next_multiple_of(4)
}
_ => unreachable!(),
}

View file

@ -656,7 +656,7 @@ fn pad_clocktime(f: &mut fmt::Formatter<'_>, sign: Sign, buf: &str) -> fmt::Resu
// Align center: Split equally between left and right side
// If the required padding is odd, the right side gets one more char
Alignment::Center => (padding / 2, 0, (padding + 1) / 2),
Alignment::Center => (padding / 2, 0, padding.div_ceil(2)),
};
// And now for the actual writing