mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 19:11:06 +00:00
Fix/silence a couple new clippy warnings
This commit is contained in:
parent
f30fcbcf9a
commit
4dade30f0d
6 changed files with 17 additions and 19 deletions
|
@ -275,7 +275,7 @@ unsafe extern "C" fn push_src_create<T: PushSrcImpl>(
|
|||
.instance_data::<super::base_src::InstanceData>(crate::BaseSrc::static_type())
|
||||
.unwrap();
|
||||
|
||||
let res = gst::panic_to_error!(&wrap, imp.panicked(), gst::FlowReturn::Error, {
|
||||
gst::panic_to_error!(&wrap, imp.panicked(), gst::FlowReturn::Error, {
|
||||
match PushSrcImpl::create(imp, wrap.unsafe_cast_ref(), buffer.as_deref_mut()) {
|
||||
Ok(CreateSuccess::NewBuffer(new_buffer)) => {
|
||||
// Clear any pending buffer list
|
||||
|
@ -357,7 +357,5 @@ unsafe extern "C" fn push_src_create<T: PushSrcImpl>(
|
|||
Err(err) => gst::FlowReturn::from(err),
|
||||
}
|
||||
})
|
||||
.into_glib();
|
||||
|
||||
res
|
||||
.into_glib()
|
||||
}
|
||||
|
|
|
@ -68,13 +68,13 @@ impl ops::DerefMut for SDPMedia {
|
|||
|
||||
impl fmt::Debug for SDPMedia {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<SDPMediaRef as fmt::Debug>::fmt(&*self, f)
|
||||
<SDPMediaRef as fmt::Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for SDPMedia {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<SDPMediaRef as fmt::Display>::fmt(&*self, f)
|
||||
<SDPMediaRef as fmt::Display>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -629,7 +629,7 @@ impl SDPMediaRef {
|
|||
|
||||
impl Borrow<SDPMediaRef> for SDPMedia {
|
||||
fn borrow(&self) -> &SDPMediaRef {
|
||||
&*self
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,13 +61,13 @@ impl ops::DerefMut for SDPMessage {
|
|||
|
||||
impl fmt::Debug for SDPMessage {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<SDPMessageRef as fmt::Debug>::fmt(&*self, f)
|
||||
<SDPMessageRef as fmt::Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for SDPMessage {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<SDPMessageRef as fmt::Display>::fmt(&*self, f)
|
||||
<SDPMessageRef as fmt::Display>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -935,7 +935,7 @@ impl SDPMessageRef {
|
|||
|
||||
impl Borrow<SDPMessageRef> for SDPMessage {
|
||||
fn borrow(&self) -> &SDPMessageRef {
|
||||
&*self
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ impl NavigationEventMessage {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
pub enum NavigationMessage {
|
||||
Event(NavigationEventMessage),
|
||||
}
|
||||
|
@ -197,12 +197,10 @@ impl NavigationMessage {
|
|||
|
||||
match event_type {
|
||||
NavigationMessageType::Event => NavigationEventMessage::parse(msg).map(Self::Event),
|
||||
_ => {
|
||||
return Err(glib::bool_error!(
|
||||
_ => Err(glib::bool_error!(
|
||||
"Unsupported navigation msg {:?}",
|
||||
event_type
|
||||
))
|
||||
}
|
||||
)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ impl ParamSpecFraction {
|
|||
}
|
||||
|
||||
pub fn upcast_ref(&self) -> &ParamSpec {
|
||||
&*self
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -255,7 +255,7 @@ impl ParamSpecArray {
|
|||
}
|
||||
|
||||
pub fn upcast_ref(&self) -> &ParamSpec {
|
||||
&*self
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ use std::sync::Arc;
|
|||
use glib::prelude::*;
|
||||
use glib::translate::*;
|
||||
|
||||
#[allow(clippy::type_complexity)]
|
||||
pub struct TaskBuilder<F: FnMut(&Task) + Send + 'static> {
|
||||
func: Box<(F, *mut ffi::GstTask)>,
|
||||
lock: Option<TaskLock>,
|
||||
|
@ -65,6 +66,7 @@ impl<F: FnMut(&Task) + Send + 'static> TaskBuilder<F> {
|
|||
callback(&from_glib_borrow(task));
|
||||
}
|
||||
|
||||
#[allow(clippy::type_complexity)]
|
||||
unsafe extern "C" fn destroy_callback(data: glib::ffi::gpointer) {
|
||||
let _callback: Box<Box<dyn FnMut(&Task) + Send + 'static>> =
|
||||
Box::from_raw(data as *mut _);
|
||||
|
|
Loading…
Reference in a new issue