mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-22 08:07:07 +00:00
Use Option::is_some_and(...)
instead of Option::map_or(false, ...)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1466>
This commit is contained in:
parent
84ea10dc73
commit
45ec7cedd9
3 changed files with 4 additions and 6 deletions
|
@ -79,9 +79,7 @@ pub fn codec_utils_aac_caps_set_level_and_profile(
|
|||
|
||||
let s = caps.structure(0).unwrap();
|
||||
assert_eq!(s.name(), "audio/mpeg");
|
||||
assert!(s
|
||||
.get::<i32>("mpegversion")
|
||||
.map_or(false, |v| v == 2 || v == 4));
|
||||
assert!(s.get::<i32>("mpegversion").is_ok_and(|v| v == 2 || v == 4));
|
||||
|
||||
let len = audio_config.len() as u32;
|
||||
unsafe {
|
||||
|
@ -199,7 +197,7 @@ pub fn codec_utils_mpeg4video_caps_set_level_and_profile(
|
|||
|
||||
let s = caps.structure(0).unwrap();
|
||||
assert_eq!(s.name(), "video/mpeg");
|
||||
assert!(s.get::<i32>("mpegversion").map_or(false, |v| v == 4));
|
||||
assert!(s.get::<i32>("mpegversion").is_ok_and(|v| v == 4));
|
||||
|
||||
let len = vis_obj_seq.len() as u32;
|
||||
unsafe {
|
||||
|
|
|
@ -236,7 +236,7 @@ impl EventRef {
|
|||
#[doc(alias = "gst_event_has_name")]
|
||||
#[inline]
|
||||
pub fn has_name(&self, name: &str) -> bool {
|
||||
self.structure().map_or(false, |s| s.has_name(name))
|
||||
self.structure().is_some_and(|s| s.has_name(name))
|
||||
}
|
||||
|
||||
pub fn view(&self) -> EventView {
|
||||
|
|
|
@ -119,7 +119,7 @@ impl MessageRef {
|
|||
#[doc(alias = "gst_message_has_name")]
|
||||
#[inline]
|
||||
pub fn has_name(&self, name: &str) -> bool {
|
||||
self.structure().map_or(false, |s| s.has_name(name))
|
||||
self.structure().is_some_and(|s| s.has_name(name))
|
||||
}
|
||||
|
||||
pub fn view(&self) -> MessageView {
|
||||
|
|
Loading…
Reference in a new issue