forked from mirrors/gstreamer-rs
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:
parent
29710d9970
commit
fc0fc99d1c
4 changed files with 4 additions and 4 deletions
|
@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue