From fc0fc99d1c7e56ed54d18ee42d9b1ccb02aaf107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 24 Sep 2019 15:03:45 +0300 Subject: [PATCH] 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))` --- gstreamer-audio/src/subclass/audio_decoder.rs | 2 +- gstreamer-audio/src/subclass/audio_encoder.rs | 2 +- gstreamer-video/src/subclass/video_decoder.rs | 2 +- gstreamer-video/src/subclass/video_encoder.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gstreamer-audio/src/subclass/audio_decoder.rs b/gstreamer-audio/src/subclass/audio_decoder.rs index e2da09ea7..968f05a0d 100644 --- a/gstreamer-audio/src/subclass/audio_decoder.rs +++ b/gstreamer-audio/src/subclass/audio_decoder.rs @@ -408,7 +408,7 @@ impl AudioDecoderImplExt for T { (*parent_class) .getcaps .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)) } } diff --git a/gstreamer-audio/src/subclass/audio_encoder.rs b/gstreamer-audio/src/subclass/audio_encoder.rs index ebe24bc89..e0e43c295 100644 --- a/gstreamer-audio/src/subclass/audio_encoder.rs +++ b/gstreamer-audio/src/subclass/audio_encoder.rs @@ -357,7 +357,7 @@ impl AudioEncoderImplExt for T { (*parent_class) .getcaps .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)) } } diff --git a/gstreamer-video/src/subclass/video_decoder.rs b/gstreamer-video/src/subclass/video_decoder.rs index 76fb49d06..dc32dbb68 100644 --- a/gstreamer-video/src/subclass/video_decoder.rs +++ b/gstreamer-video/src/subclass/video_decoder.rs @@ -397,7 +397,7 @@ impl VideoDecoderImplExt for T { (*parent_class) .getcaps .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)) } } diff --git a/gstreamer-video/src/subclass/video_encoder.rs b/gstreamer-video/src/subclass/video_encoder.rs index be69e572f..2eee95eb8 100644 --- a/gstreamer-video/src/subclass/video_encoder.rs +++ b/gstreamer-video/src/subclass/video_encoder.rs @@ -333,7 +333,7 @@ impl VideoEncoderImplExt for T { (*parent_class) .getcaps .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)) } }