From e8638c16305068b50b6b084519bbd3ded412689d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 5 Nov 2017 19:16:50 +0200 Subject: [PATCH] Mark various enums that can signal errors as #[must_use] See https://github.com/sdroege/gstreamer-rs/issues/44 --- Gir_Gst.toml | 24 ++++++++++++++++++++---- gstreamer/src/auto/enums.rs | 4 ++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/Gir_Gst.toml b/Gir_Gst.toml index a3ef354ba..c2f7bc7be 100644 --- a/Gir_Gst.toml +++ b/Gir_Gst.toml @@ -18,11 +18,9 @@ generate = [ "Gst.ClockTimeDiff", "Gst.Pipeline", "Gst.State", - "Gst.StateChangeReturn", "Gst.StateChange", "Gst.SeekFlags", "Gst.SeekType", - "Gst.FlowReturn", "Gst.PadDirection", "Gst.PadPresence", "Gst.URIHandler", @@ -44,7 +42,6 @@ generate = [ "Gst.DeviceMonitor", "Gst.StreamType", "Gst.StreamFlags", - "Gst.PadLinkReturn", "Gst.ProgressType", "Gst.BusSyncReply", "Gst.TagMergeMode", @@ -65,7 +62,6 @@ generate = [ "Gst.TocLoopType", "Gst.TocSetter", "Gst.ClockType", - "Gst.ClockReturn", "Gst.ElementFlags", "Gst.Rank", "Gst.PadLinkCheck", @@ -705,3 +701,23 @@ status = "generate" pattern = "parse.*full" # wrong mutable for context parameter ignore = true + +[[object]] +name = "Gst.StateChangeReturn" +status = "generate" +must_use = true + +[[object]] +name = "Gst.FlowReturn" +status = "generate" +must_use = true + +[[object]] +name = "Gst.PadLinkReturn" +status = "generate" +must_use = true + +[[object]] +name = "Gst.ClockReturn" +status = "generate" +must_use = true diff --git a/gstreamer/src/auto/enums.rs b/gstreamer/src/auto/enums.rs index f3b3940d0..33cf37d27 100644 --- a/gstreamer/src/auto/enums.rs +++ b/gstreamer/src/auto/enums.rs @@ -191,6 +191,7 @@ impl SetValue for CapsIntersectMode { } #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +#[must_use] pub enum ClockReturn { Ok, Early, @@ -677,6 +678,7 @@ impl SetValue for EventType { } #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +#[must_use] pub enum FlowReturn { CustomSuccess2, CustomSuccess1, @@ -993,6 +995,7 @@ impl SetValue for PadDirection { } #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +#[must_use] pub enum PadLinkReturn { Ok, WrongHierarchy, @@ -1950,6 +1953,7 @@ impl SetValue for StateChange { } #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +#[must_use] pub enum StateChangeReturn { Failure, Success,