diff --git a/gstreamer/src/buffer.rs b/gstreamer/src/buffer.rs index c6c4029c6..70d8018ac 100644 --- a/gstreamer/src/buffer.rs +++ b/gstreamer/src/buffer.rs @@ -221,7 +221,7 @@ impl BufferRef { return Err(glib::bool_error!("Invalid range start")); } ops::Bound::Included(idx) => *idx, - ops::Bound::Excluded(idx) if idx.checked_add(1).map_or(true, |idx| idx >= n_memory) => { + ops::Bound::Excluded(idx) if idx.checked_add(1).is_none_or(|idx| idx >= n_memory) => { return Err(glib::bool_error!("Invalid range start")); } ops::Bound::Excluded(idx) => *idx + 1, @@ -229,7 +229,7 @@ impl BufferRef { }; let end_idx = match range.end_bound() { - ops::Bound::Included(idx) if idx.checked_add(1).map_or(true, |idx| idx > n_memory) => { + ops::Bound::Included(idx) if idx.checked_add(1).is_none_or(|idx| idx > n_memory) => { return Err(glib::bool_error!("Invalid range end")); } ops::Bound::Included(idx) => *idx + 1, @@ -313,7 +313,7 @@ impl BufferRef { return Err(glib::bool_error!("Invalid range start")); } ops::Bound::Included(idx) => *idx, - ops::Bound::Excluded(idx) if idx.checked_add(1).map_or(true, |idx| idx >= size) => { + ops::Bound::Excluded(idx) if idx.checked_add(1).is_none_or(|idx| idx >= size) => { return Err(glib::bool_error!("Invalid range start")); } ops::Bound::Excluded(idx) => *idx + 1, @@ -321,7 +321,7 @@ impl BufferRef { }; let end_idx = match range.end_bound() { - ops::Bound::Included(idx) if idx.checked_add(1).map_or(true, |idx| idx > size) => { + ops::Bound::Included(idx) if idx.checked_add(1).is_none_or(|idx| idx > size) => { return Err(glib::bool_error!("Invalid range end")); } ops::Bound::Included(idx) => *idx + 1, @@ -1399,7 +1399,7 @@ impl Dump<'_> { write!(f, "")?; return Ok(()); } - Bound::Excluded(idx) if idx.checked_add(1).map_or(true, |idx| idx >= len) => { + Bound::Excluded(idx) if idx.checked_add(1).is_none_or(|idx| idx >= len) => { write!(f, "")?; return Ok(()); } @@ -1409,7 +1409,7 @@ impl Dump<'_> { }; let end_idx = match self.end { - Bound::Included(idx) if idx.checked_add(1).map_or(true, |idx| idx > len) => { + Bound::Included(idx) if idx.checked_add(1).is_none_or(|idx| idx > len) => { write!(f, "")?; return Ok(()); } diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index e874b7349..5405204b0 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -2176,7 +2176,7 @@ impl + IsA + glib::object::IsClass> PadBuilder { Some("u") => { if name_part .get(conv_spec_start..) - .map_or(true, |s| s.parse::().is_err()) + .is_none_or(|s| s.parse::().is_err()) { crate::debug!( CAT_RUST, @@ -2191,7 +2191,7 @@ impl + IsA + glib::object::IsClass> PadBuilder { Some("d") => { if name_part .get(conv_spec_start..) - .map_or(true, |s| s.parse::().is_err()) + .is_none_or(|s| s.parse::().is_err()) { crate::debug!( CAT_RUST, diff --git a/gstreamer/src/slice.rs b/gstreamer/src/slice.rs index f968773e7..8554157fa 100644 --- a/gstreamer/src/slice.rs +++ b/gstreamer/src/slice.rs @@ -46,7 +46,7 @@ impl Dump<'_> { write!(f, "")?; return Ok(()); } - Bound::Excluded(idx) if idx.checked_add(1).map_or(true, |idx| idx >= len) => { + Bound::Excluded(idx) if idx.checked_add(1).is_none_or(|idx| idx >= len) => { write!(f, "")?; return Ok(()); } @@ -56,7 +56,7 @@ impl Dump<'_> { }; let end_idx = match self.end { - Bound::Included(idx) if idx.checked_add(1).map_or(true, |idx| idx > len) => { + Bound::Included(idx) if idx.checked_add(1).is_none_or(|idx| idx > len) => { write!(f, "")?; return Ok(()); }