From d0b944b2a7ca21d8f79ffc70e4dd4030ca3467c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 8 Feb 2024 13:02:37 +0200 Subject: [PATCH] Fix a couple of compiler/clippy warnings with `--no-default-features` Part-of: --- .../fallbackswitch/src/fallbackswitch/imp.rs | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/utils/fallbackswitch/src/fallbackswitch/imp.rs b/utils/fallbackswitch/src/fallbackswitch/imp.rs index 42c994e3..1906571a 100644 --- a/utils/fallbackswitch/src/fallbackswitch/imp.rs +++ b/utils/fallbackswitch/src/fallbackswitch/imp.rs @@ -984,16 +984,23 @@ impl FallbackSwitch { // be NONE by now let pts = buffer.pts().unwrap(); - let mut builder = gst::event::Gap::builder(pts) - .duration(buffer.duration()) - .seqnum(in_gap_event.seqnum()); - - #[cfg(feature = "v1_20")] - { - builder = builder.gap_flags(in_gap_event.gap_flags()); - } - - let out_gap_event = builder.build(); + let out_gap_event = { + #[cfg(feature = "v1_20")] + { + gst::event::Gap::builder(pts) + .duration(buffer.duration()) + .seqnum(in_gap_event.seqnum()) + .gap_flags(in_gap_event.gap_flags()) + .build() + } + #[cfg(not(feature = "v1_20"))] + { + gst::event::Gap::builder(pts) + .duration(buffer.duration()) + .seqnum(in_gap_event.seqnum()) + .build() + } + }; self.with_src_busy(|| { self.src_pad.push_event(out_gap_event);