base: Fix some new clippy warnings

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1730>
This commit is contained in:
Sebastian Dröge 2025-05-21 14:24:40 +03:00 committed by GStreamer Marge Bot
parent 9b01dffc63
commit c3d3ce5f2d
2 changed files with 3 additions and 4 deletions

View file

@ -258,8 +258,7 @@ impl io::Read for Adapter {
len = buf.len(); len = buf.len();
} }
self.copy(0, &mut buf[0..len]) self.copy(0, &mut buf[0..len]).map_err(io::Error::other)?;
.map_err(|err| io::Error::new(io::ErrorKind::Other, err))?;
self.flush(len); self.flush(len);

View file

@ -454,14 +454,14 @@ pub trait BaseTransformImplExt: BaseTransformImpl {
(&mut outbuf) as *mut *mut gst::ffi::GstBuffer as *mut gst::ffi::GstBuffer, (&mut outbuf) as *mut *mut gst::ffi::GstBuffer as *mut gst::ffi::GstBuffer,
)) ))
.map(|_| { .map(|_| {
if outbuf == buf as *mut _ { if ptr::eq(outbuf, buf as *mut _) {
PrepareOutputBufferSuccess::InputBuffer PrepareOutputBufferSuccess::InputBuffer
} else { } else {
PrepareOutputBufferSuccess::Buffer(from_glib_full(outbuf)) PrepareOutputBufferSuccess::Buffer(from_glib_full(outbuf))
} }
}) })
.inspect_err(|_err| { .inspect_err(|_err| {
if outbuf != buf as *mut _ { if !ptr::eq(outbuf, buf as *mut _) {
drop(Option::<gst::Buffer>::from_glib_full(outbuf)); drop(Option::<gst::Buffer>::from_glib_full(outbuf));
} }
}) })