audio/video: Fix some clippy warnings

warning: use of `unwrap_or` followed by a function call
   --> gstreamer-audio/src/subclass/audio_encoder.rs:360:18
    |
360 |                 .unwrap_or(element.proxy_getcaps(None, filter))
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | help: try this: `unwrap_or_else(|| element.proxy_getcaps(None, filter))`
This commit is contained in:
Sebastian Dröge 2019-09-24 15:03:45 +03:00
parent 29710d9970
commit fc0fc99d1c
4 changed files with 4 additions and 4 deletions

View file

@ -408,7 +408,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
(*parent_class) (*parent_class)
.getcaps .getcaps
.map(|f| from_glib_full(f(element.to_glib_none().0, filter.to_glib_none().0))) .map(|f| from_glib_full(f(element.to_glib_none().0, filter.to_glib_none().0)))
.unwrap_or(element.proxy_getcaps(None, filter)) .unwrap_or_else(|| element.proxy_getcaps(None, filter))
} }
} }

View file

@ -357,7 +357,7 @@ impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
(*parent_class) (*parent_class)
.getcaps .getcaps
.map(|f| from_glib_full(f(element.to_glib_none().0, filter.to_glib_none().0))) .map(|f| from_glib_full(f(element.to_glib_none().0, filter.to_glib_none().0)))
.unwrap_or(element.proxy_getcaps(None, filter)) .unwrap_or_else(|| element.proxy_getcaps(None, filter))
} }
} }

View file

@ -397,7 +397,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
(*parent_class) (*parent_class)
.getcaps .getcaps
.map(|f| from_glib_full(f(element.to_glib_none().0, filter.to_glib_none().0))) .map(|f| from_glib_full(f(element.to_glib_none().0, filter.to_glib_none().0)))
.unwrap_or(element.proxy_getcaps(None, filter)) .unwrap_or_else(|| element.proxy_getcaps(None, filter))
} }
} }

View file

@ -333,7 +333,7 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
(*parent_class) (*parent_class)
.getcaps .getcaps
.map(|f| from_glib_full(f(element.to_glib_none().0, filter.to_glib_none().0))) .map(|f| from_glib_full(f(element.to_glib_none().0, filter.to_glib_none().0)))
.unwrap_or(element.proxy_getcaps(None, filter)) .unwrap_or_else(|| element.proxy_getcaps(None, filter))
} }
} }