From f8d17555c5e55dab29cbf71f6dc6485c9accbf2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 14 Jan 2023 19:04:08 +0200 Subject: [PATCH] utils: streamproducer: Add `#[must_use]` attribute to `add_consumer()` Simply discarding the result will immediately disconnect it again, which was likely not intended and can easily lead to bugs. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/432 Part-of: --- gstreamer-utils/src/streamproducer.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/gstreamer-utils/src/streamproducer.rs b/gstreamer-utils/src/streamproducer.rs index 57d3a28d1..92c26c950 100644 --- a/gstreamer-utils/src/streamproducer.rs +++ b/gstreamer-utils/src/streamproducer.rs @@ -40,6 +40,7 @@ impl Eq for StreamProducer {} /// Link between a `StreamProducer` and a consumer, disconnecting the link on `Drop`. /// The producer and consumer will stay alive while the link is. #[derive(Debug)] +#[must_use] pub struct ConsumptionLink { consumer: gst_app::AppSrc, producer: Option,