base/base_transform: Fix minor clippy warning

warning: called `map(f)` on an Option value where `f` is a unit closure
   --> gstreamer-base/src/subclass/base_transform.rs:683:13
    |
683 | /             (*parent_class)
684 | |                 .before_transform
685 | |                 .map(|f| f(element.to_glib_none().0, inbuf.as_ptr() as *mut _));
    | |_______________________________________________________________________________^
    |
    = note: `#[warn(clippy::option_map_unit_fn)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn
This commit is contained in:
Sebastian Dröge 2020-02-09 21:22:04 +02:00
parent 09212add47
commit 870978e286

View file

@ -680,9 +680,9 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
let data = self.get_type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
(*parent_class)
.before_transform
.map(|f| f(element.to_glib_none().0, inbuf.as_ptr() as *mut _));
if let Some(ref f) = (*parent_class).before_transform {
f(element.to_glib_none().0, inbuf.as_ptr() as *mut _);
}
}
}