From cb842064572262d3e477416abf4fe09bb50d4a7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 28 Jun 2022 14:52:20 +0300 Subject: [PATCH] Fix a couple of new 1.62 clippy warnings --- generic/threadshare/src/udpsink/imp.rs | 4 +--- net/reqwest/tests/reqwesthttpsrc.rs | 6 +++--- text/ahead/src/textahead/imp.rs | 10 +++++++--- utils/fallbackswitch/src/fallbacksrc/imp.rs | 2 +- utils/fallbackswitch/src/fallbackswitch/imp.rs | 2 -- utils/uriplaylistbin/src/uriplaylistbin/imp.rs | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/generic/threadshare/src/udpsink/imp.rs b/generic/threadshare/src/udpsink/imp.rs index 287f2570..1dd8935b 100644 --- a/generic/threadshare/src/udpsink/imp.rs +++ b/generic/threadshare/src/udpsink/imp.rs @@ -530,9 +530,7 @@ impl UdpSinkPadHandler { let now = element.current_running_time(); match running_time.into().opt_checked_sub(now) { - Ok(Some(delay)) => { - let _ = runtime::time::delay_for(delay.into()).await; - } + Ok(Some(delay)) => runtime::time::delay_for(delay.into()).await, _ => runtime::executor::yield_now().await, } } diff --git a/net/reqwest/tests/reqwesthttpsrc.rs b/net/reqwest/tests/reqwesthttpsrc.rs index 5dc7ff34..ab404428 100644 --- a/net/reqwest/tests/reqwesthttpsrc.rs +++ b/net/reqwest/tests/reqwesthttpsrc.rs @@ -889,7 +889,7 @@ fn test_seek_after_ready() { if range == "bytes=123-" { let mut data_seek = vec![0; 8192 - 123]; for (i, d) in data_seek.iter_mut().enumerate() { - *d = (i + 123 % 256) as u8; + *d = ((i + 123) % 256) as u8; } Response::builder() @@ -971,7 +971,7 @@ fn test_seek_after_buffer_received() { if range == "bytes=123-" { let mut data_seek = vec![0; 8192 - 123]; for (i, d) in data_seek.iter_mut().enumerate() { - *d = (i + 123 % 256) as u8; + *d = ((i + 123) % 256) as u8; } Response::builder() @@ -1049,7 +1049,7 @@ fn test_seek_with_stop_position() { if range == "bytes=123-130" { let mut data_seek = vec![0; 8]; for (i, d) in data_seek.iter_mut().enumerate() { - *d = (i + 123 % 256) as u8; + *d = ((i + 123) % 256) as u8; } Response::builder() diff --git a/text/ahead/src/textahead/imp.rs b/text/ahead/src/textahead/imp.rs index 7c6a64f1..1ecf4d3f 100644 --- a/text/ahead/src/textahead/imp.rs +++ b/text/ahead/src/textahead/imp.rs @@ -344,10 +344,14 @@ impl TextAhead { if settings.ahead_attributes.is_empty() { text.push_str(&input.text); } else { - text.push_str(&format!( + use std::fmt::Write; + + write!( + &mut text, "{}", - settings.ahead_attributes, input.text - )); + settings.ahead_attributes, input.text, + ) + .unwrap(); } } diff --git a/utils/fallbackswitch/src/fallbacksrc/imp.rs b/utils/fallbackswitch/src/fallbacksrc/imp.rs index d16f3a2c..a1209502 100644 --- a/utils/fallbackswitch/src/fallbacksrc/imp.rs +++ b/utils/fallbackswitch/src/fallbacksrc/imp.rs @@ -2100,7 +2100,7 @@ impl FallbackSrc { fallback_input.call_async(|fallback_input| { // Re-run video fallback input with videotestsrc let _ = fallback_input.set_state(gst::State::Null); - let _ = fallback_input.set_property("uri", None::<&str>); + fallback_input.set_property("uri", None::<&str>); let _ = fallback_input.sync_state_with_parent(); }); diff --git a/utils/fallbackswitch/src/fallbackswitch/imp.rs b/utils/fallbackswitch/src/fallbackswitch/imp.rs index 18ac958c..f4b56e4c 100644 --- a/utils/fallbackswitch/src/fallbackswitch/imp.rs +++ b/utils/fallbackswitch/src/fallbackswitch/imp.rs @@ -628,8 +628,6 @@ impl FallbackSwitch { state.first = false; } - drop(pad_settings); - if switch_to_pad { state.timed_out = false; self.set_active_pad(&mut state, pad); diff --git a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs index b7c598e9..44c39fac 100644 --- a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs +++ b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs @@ -69,7 +69,7 @@ impl StreamsTopology { } } -impl<'a> From for StreamsTopology { +impl From for StreamsTopology { fn from(collection: gst::StreamCollection) -> Self { let (mut audio, mut video, mut text) = (0, 0, 0); for stream in collection.iter() {