From ac9b1e881c5571a39d79a823df40fe4c15d4576c Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 4 Jan 2022 19:43:07 +0100 Subject: [PATCH] Add missing #[must_use] attribute for clippy --- gstreamer-pbutils/src/encoding_profile.rs | 8 ++++++++ gstreamer/src/enums.rs | 1 + gstreamer/src/iterator.rs | 1 + gstreamer/src/miniobject.rs | 1 + 4 files changed, 11 insertions(+) diff --git a/gstreamer-pbutils/src/encoding_profile.rs b/gstreamer-pbutils/src/encoding_profile.rs index 98b825c3e..0fb921911 100644 --- a/gstreamer-pbutils/src/encoding_profile.rs +++ b/gstreamer-pbutils/src/encoding_profile.rs @@ -316,21 +316,29 @@ impl<'a> EncodingProfileBuilderCommonData<'a> { pub trait EncodingProfileBuilder<'a>: Sized { #[doc(alias = "gst_encoding_profile_set_name")] + #[must_use] fn name(self, name: &'a str) -> Self; #[doc(alias = "gst_encoding_profile_set_description")] + #[must_use] fn description(self, description: &'a str) -> Self; #[doc(alias = "gst_encoding_profile_set_preset")] + #[must_use] fn preset(self, preset: &'a str) -> Self; #[doc(alias = "gst_encoding_profile_set_preset_name")] + #[must_use] fn preset_name(self, preset_name: &'a str) -> Self; #[doc(alias = "gst_encoding_profile_set_presence")] + #[must_use] fn presence(self, presence: u32) -> Self; #[doc(alias = "gst_encoding_profile_set_allow_dynamic_output")] + #[must_use] fn allow_dynamic_output(self, allow: bool) -> Self; #[doc(alias = "gst_encoding_profile_set_enabled")] + #[must_use] fn enabled(self, enabled: bool) -> Self; #[cfg(feature = "v1_18")] #[doc(alias = "gst_encoding_profile_set_single_segment")] + #[must_use] fn single_segment(self, single_segment: bool) -> Self; } diff --git a/gstreamer/src/enums.rs b/gstreamer/src/enums.rs index fa20365b3..34a3ad57d 100644 --- a/gstreamer/src/enums.rs +++ b/gstreamer/src/enums.rs @@ -644,6 +644,7 @@ impl ToValue for MessageType { } impl State { + #[must_use] pub fn next(self, pending: Self) -> Self { let current = self.into_glib(); let pending = pending.into_glib(); diff --git a/gstreamer/src/iterator.rs b/gstreamer/src/iterator.rs index b059b8de1..fe71b6fdd 100644 --- a/gstreamer/src/iterator.rs +++ b/gstreamer/src/iterator.rs @@ -66,6 +66,7 @@ where } #[doc(alias = "gst_iterator_filter")] + #[must_use] pub fn filter(self, func: F) -> Self where F: Fn(T) -> bool + Send + Sync + 'static, diff --git a/gstreamer/src/miniobject.rs b/gstreamer/src/miniobject.rs index 71d190674..a4522a784 100644 --- a/gstreamer/src/miniobject.rs +++ b/gstreamer/src/miniobject.rs @@ -92,6 +92,7 @@ macro_rules! mini_object_wrapper ( } } + #[must_use] pub fn upcast(self) -> $crate::miniobject::MiniObject { unsafe { from_glib_full(self.into_ptr() as *mut $crate::ffi::GstMiniObject)