Get rid of various clippy warnings

This commit is contained in:
Sebastian Dröge 2017-09-26 01:58:19 +03:00
parent 515f58da02
commit cba662934c
4 changed files with 14 additions and 16 deletions

View file

@ -146,7 +146,7 @@ impl Demuxer {
flow_combiner: Mutex::new(Default::default()), flow_combiner: Mutex::new(Default::default()),
group_id: Mutex::new(gst::util_group_id_next()), group_id: Mutex::new(gst::util_group_id_next()),
srcpads: Mutex::new(BTreeMap::new()), srcpads: Mutex::new(BTreeMap::new()),
imp: Mutex::new(((demuxer_info.create_instance)(demuxer))), imp: Mutex::new((demuxer_info.create_instance)(demuxer)),
} }
} }
@ -345,7 +345,7 @@ impl Demuxer {
) -> bool { ) -> bool {
let element = parent let element = parent
.as_ref() .as_ref()
.map(|o| o.clone()) .cloned()
.unwrap() .unwrap()
.downcast::<RsElement>() .downcast::<RsElement>()
.unwrap(); .unwrap();
@ -390,7 +390,7 @@ impl Demuxer {
) -> gst::FlowReturn { ) -> gst::FlowReturn {
let element = parent let element = parent
.as_ref() .as_ref()
.map(|o| o.clone()) .cloned()
.unwrap() .unwrap()
.downcast::<RsElement>() .downcast::<RsElement>()
.unwrap(); .unwrap();
@ -488,7 +488,7 @@ impl Demuxer {
let element = parent let element = parent
.as_ref() .as_ref()
.map(|o| o.clone()) .cloned()
.unwrap() .unwrap()
.downcast::<RsElement>() .downcast::<RsElement>()
.unwrap(); .unwrap();
@ -523,7 +523,7 @@ impl Demuxer {
let element = parent let element = parent
.as_ref() .as_ref()
.map(|o| o.clone()) .cloned()
.unwrap() .unwrap()
.downcast::<RsElement>() .downcast::<RsElement>()
.unwrap(); .unwrap();
@ -630,7 +630,7 @@ impl Demuxer {
gst_debug!(self.cat, obj: element, "Seeked after EOS"); gst_debug!(self.cat, obj: element, "Seeked after EOS");
*offset = u64::MAX; *offset = u64::MAX;
self.stream_eos(&element, None); self.stream_eos(element, None);
true true
} }

View file

@ -39,14 +39,12 @@ macro_rules! floating_reference_guard {
pub struct FloatingReferenceGuard(*mut gobject_ffi::GObject); pub struct FloatingReferenceGuard(*mut gobject_ffi::GObject);
impl FloatingReferenceGuard { impl FloatingReferenceGuard {
pub fn new(obj: *mut gobject_ffi::GObject) -> Option<FloatingReferenceGuard> { pub unsafe fn new(obj: *mut gobject_ffi::GObject) -> Option<FloatingReferenceGuard> {
unsafe { if gobject_ffi::g_object_is_floating(obj) != glib_ffi::GFALSE {
if gobject_ffi::g_object_is_floating(obj) != glib_ffi::GFALSE { gobject_ffi::g_object_ref_sink(obj);
gobject_ffi::g_object_ref_sink(obj); Some(FloatingReferenceGuard(obj))
Some(FloatingReferenceGuard(obj)) } else {
} else { None
None
}
} }
} }
} }

View file

@ -142,7 +142,7 @@ impl<T: ObjectType> ClassStruct<T> {
return ptr::null_mut(); return ptr::null_mut();
} }
for &(t, p) in (*self.interfaces_static).iter() { for &(t, p) in &(*self.interfaces_static) {
if t == type_ { if t == type_ {
return p; return p;
} }

View file

@ -278,7 +278,7 @@ impl BaseSrcImpl<RsBaseSrc> for Source {
let start = segment.get_start(); let start = segment.get_start();
let stop = match segment.get_stop() { let stop = match segment.get_stop() {
u64::MAX => None, u64::MAX => None,
stop @ _ => Some(stop), stop => Some(stop),
}; };
gst_debug!(self.cat, obj: src, "Seeking to {:?}-{:?}", start, stop); gst_debug!(self.cat, obj: src, "Seeking to {:?}-{:?}", start, stop);