meta: MetaTransformCopy accept 0.. as equivalent to ..

If the range is 0.., then there is no region

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1776>
This commit is contained in:
Olivier Crête 2025-08-21 09:33:23 -04:00 committed by GStreamer Marge Bot
parent 672c19dad0
commit 032e9a7f75

View file

@ -1115,8 +1115,8 @@ impl MetaTransformCopy {
pub fn new(range: impl RangeBounds<usize>) -> Self {
skip_assert_initialized!();
let region =
!(range.start_bound() == Bound::Unbounded && range.end_bound() == Bound::Unbounded);
let region = !(matches!(range.start_bound(), Bound::Unbounded | Bound::Included(0))
&& range.end_bound() == Bound::Unbounded);
let (offset, size) = if region {
(