mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-09-02 09:53:49 +00:00
gstreamer: Fix some new clippy warnings because of the MSRV bump
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1713>
This commit is contained in:
parent
187651b416
commit
8e475a9011
3 changed files with 10 additions and 10 deletions
|
@ -221,7 +221,7 @@ impl BufferRef {
|
||||||
return Err(glib::bool_error!("Invalid range start"));
|
return Err(glib::bool_error!("Invalid range start"));
|
||||||
}
|
}
|
||||||
ops::Bound::Included(idx) => *idx,
|
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"));
|
return Err(glib::bool_error!("Invalid range start"));
|
||||||
}
|
}
|
||||||
ops::Bound::Excluded(idx) => *idx + 1,
|
ops::Bound::Excluded(idx) => *idx + 1,
|
||||||
|
@ -229,7 +229,7 @@ impl BufferRef {
|
||||||
};
|
};
|
||||||
|
|
||||||
let end_idx = match range.end_bound() {
|
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"));
|
return Err(glib::bool_error!("Invalid range end"));
|
||||||
}
|
}
|
||||||
ops::Bound::Included(idx) => *idx + 1,
|
ops::Bound::Included(idx) => *idx + 1,
|
||||||
|
@ -313,7 +313,7 @@ impl BufferRef {
|
||||||
return Err(glib::bool_error!("Invalid range start"));
|
return Err(glib::bool_error!("Invalid range start"));
|
||||||
}
|
}
|
||||||
ops::Bound::Included(idx) => *idx,
|
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"));
|
return Err(glib::bool_error!("Invalid range start"));
|
||||||
}
|
}
|
||||||
ops::Bound::Excluded(idx) => *idx + 1,
|
ops::Bound::Excluded(idx) => *idx + 1,
|
||||||
|
@ -321,7 +321,7 @@ impl BufferRef {
|
||||||
};
|
};
|
||||||
|
|
||||||
let end_idx = match range.end_bound() {
|
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"));
|
return Err(glib::bool_error!("Invalid range end"));
|
||||||
}
|
}
|
||||||
ops::Bound::Included(idx) => *idx + 1,
|
ops::Bound::Included(idx) => *idx + 1,
|
||||||
|
@ -1399,7 +1399,7 @@ impl Dump<'_> {
|
||||||
write!(f, "<start out of range>")?;
|
write!(f, "<start out of range>")?;
|
||||||
return Ok(());
|
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, "<start out of range>")?;
|
write!(f, "<start out of range>")?;
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
@ -1409,7 +1409,7 @@ impl Dump<'_> {
|
||||||
};
|
};
|
||||||
|
|
||||||
let end_idx = match self.end {
|
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, "<end out of range>")?;
|
write!(f, "<end out of range>")?;
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
|
@ -2176,7 +2176,7 @@ impl<T: IsA<Pad> + IsA<glib::Object> + glib::object::IsClass> PadBuilder<T> {
|
||||||
Some("u") => {
|
Some("u") => {
|
||||||
if name_part
|
if name_part
|
||||||
.get(conv_spec_start..)
|
.get(conv_spec_start..)
|
||||||
.map_or(true, |s| s.parse::<u32>().is_err())
|
.is_none_or(|s| s.parse::<u32>().is_err())
|
||||||
{
|
{
|
||||||
crate::debug!(
|
crate::debug!(
|
||||||
CAT_RUST,
|
CAT_RUST,
|
||||||
|
@ -2191,7 +2191,7 @@ impl<T: IsA<Pad> + IsA<glib::Object> + glib::object::IsClass> PadBuilder<T> {
|
||||||
Some("d") => {
|
Some("d") => {
|
||||||
if name_part
|
if name_part
|
||||||
.get(conv_spec_start..)
|
.get(conv_spec_start..)
|
||||||
.map_or(true, |s| s.parse::<i32>().is_err())
|
.is_none_or(|s| s.parse::<i32>().is_err())
|
||||||
{
|
{
|
||||||
crate::debug!(
|
crate::debug!(
|
||||||
CAT_RUST,
|
CAT_RUST,
|
||||||
|
|
|
@ -46,7 +46,7 @@ impl Dump<'_> {
|
||||||
write!(f, "<start out of range>")?;
|
write!(f, "<start out of range>")?;
|
||||||
return Ok(());
|
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, "<start out of range>")?;
|
write!(f, "<start out of range>")?;
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ impl Dump<'_> {
|
||||||
};
|
};
|
||||||
|
|
||||||
let end_idx = match self.end {
|
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, "<end out of range>")?;
|
write!(f, "<end out of range>")?;
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue