diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2020-04-08 15:24:07 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2020-04-08 15:24:07 +0300 |
commit | 4206b53c09ce049c68b6c8decdc220f6687468b8 (patch) | |
tree | 1ca7053451b87ed10155d349258ae26bedb1ef0e /utils | |
parent | 7173790da26ef054bf30c74f43bf7585b52f35cb (diff) |
Mark GMutex mutex guards as #[must_use]
See gstreamer-rs commit b21f5764309f9f65666016a9069e1b938935e6f2
Diffstat (limited to 'utils')
-rw-r--r-- | utils/fallbackswitch/src/base/aggregator_pad.rs | 2 | ||||
-rw-r--r-- | utils/fallbackswitch/src/base/utils.rs | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/utils/fallbackswitch/src/base/aggregator_pad.rs b/utils/fallbackswitch/src/base/aggregator_pad.rs index eb57f6143..38c473272 100644 --- a/utils/fallbackswitch/src/base/aggregator_pad.rs +++ b/utils/fallbackswitch/src/base/aggregator_pad.rs @@ -21,7 +21,7 @@ impl<O: IsA<AggregatorPad>> AggregatorPadExtManual for O { fn get_segment(&self) -> gst::Segment { unsafe { let ptr: &gst_base_sys::GstAggregatorPad = &*(self.as_ptr() as *const _); - super::utils::MutexGuard::lock(&ptr.parent.object.lock); + let _guard = super::utils::MutexGuard::lock(&ptr.parent.object.lock); from_glib_none(&ptr.segment as *const gst_sys::GstSegment) } } diff --git a/utils/fallbackswitch/src/base/utils.rs b/utils/fallbackswitch/src/base/utils.rs index dca8cf691..ff456cd06 100644 --- a/utils/fallbackswitch/src/base/utils.rs +++ b/utils/fallbackswitch/src/base/utils.rs @@ -9,6 +9,7 @@ use glib::translate::mut_override; use glib_sys; +#[must_use = "if unused the Mutex will immediately unlock"] pub struct MutexGuard<'a>(&'a glib_sys::GMutex); impl<'a> MutexGuard<'a> { |