Fix new Rust 1.81 clippy warnings

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1768>
This commit is contained in:
Sebastian Dröge 2024-09-05 22:01:01 +03:00
parent 295b9f01c2
commit a709eb96d9
4 changed files with 4 additions and 10 deletions

View file

@ -541,7 +541,7 @@ unsafe impl<T: IoSafe + Write> IoSafe for std::io::BufWriter<T> {}
unsafe impl<T: IoSafe + Write> IoSafe for std::io::LineWriter<T> {}
unsafe impl<T: IoSafe + ?Sized> IoSafe for &mut T {}
unsafe impl<T: IoSafe + ?Sized> IoSafe for Box<T> {}
unsafe impl<T: Clone + IoSafe + ?Sized> IoSafe for std::borrow::Cow<'_, T> {}
unsafe impl<T: Clone + IoSafe> IoSafe for std::borrow::Cow<'_, T> {}
impl<T: Read + Send + 'static> AsyncRead for Async<T> {
fn poll_read(

View file

@ -218,7 +218,7 @@ fn multiple_contexts_proxy() {
.name(format!("proxysrc-{pipeline_index}").as_str())
.property(
"context",
&format!("context-{}", (pipeline_index as u32) % CONTEXT_NB),
format!("context-{}", (pipeline_index as u32) % CONTEXT_NB),
)
.property("proxy-context", format!("proxy-{pipeline_index}"))
.build()

View file

@ -74,10 +74,7 @@ impl Default for Settings {
cookies: Vec::new(),
iradio_mode: DEFAULT_IRADIO_MODE,
keep_alive: DEFAULT_KEEP_ALIVE,
proxy: match proxy_from_str(std::env::var("http_proxy").ok()) {
Ok(a) => a,
Err(_) => None,
},
proxy: proxy_from_str(std::env::var("http_proxy").ok()).unwrap_or_default(),
proxy_id: None,
proxy_pw: None,
}

View file

@ -159,10 +159,7 @@ impl JsonGstEnc {
let mut state = self.state.lock().unwrap();
let caps = e.caps();
let s = caps.structure(0).unwrap();
state.format = match s.get::<Option<String>>("format") {
Err(_) => None,
Ok(format) => format,
};
state.format = s.get::<Option<String>>("format").unwrap_or_default();
}
// We send our own caps downstream