diff --git a/components/bluetooth/empty.rs b/components/bluetooth/empty.rs index 27773a10a47..b9f4e7f5f0e 100644 --- a/components/bluetooth/empty.rs +++ b/components/bluetooth/empty.rs @@ -6,7 +6,7 @@ use std::collections::HashMap; use std::error::Error; use std::sync::Arc; -const NOT_SUPPORTED_ERROR: &'static str = "Error! Not supported platform!"; +const NOT_SUPPORTED_ERROR: &str = "Error! Not supported platform!"; #[derive(Clone, Debug)] pub struct EmptyAdapter {} diff --git a/components/devtools/actors/browsing_context.rs b/components/devtools/actors/browsing_context.rs index 453e373fb88..30bc0211cbf 100644 --- a/components/devtools/actors/browsing_context.rs +++ b/components/devtools/actors/browsing_context.rs @@ -298,7 +298,7 @@ impl BrowsingContextActor { if let Some(p) = pipeline { self.active_pipeline.set(p); } - *self.url.borrow_mut() = url.as_str().to_owned(); + url.as_str().clone_into(&mut self.url.borrow_mut()); if let Some(ref t) = title { self.title.borrow_mut().clone_from(t); } diff --git a/components/devtools/actors/network_event.rs b/components/devtools/actors/network_event.rs index f4382d904f9..97d45665ae2 100644 --- a/components/devtools/actors/network_event.rs +++ b/components/devtools/actors/network_event.rs @@ -191,7 +191,7 @@ impl Actor for NetworkEventActor { let mut headersSize = 0; for (name, value) in self.request.headers.iter() { let value = &value.to_str().unwrap().to_string(); - rawHeadersString = rawHeadersString + name.as_str() + ":" + &value + "\r\n"; + rawHeadersString = rawHeadersString + name.as_str() + ":" + value + "\r\n"; headersSize += name.as_str().len() + value.len(); headers.push(Header { name: name.as_str().to_owned(), @@ -346,7 +346,7 @@ impl NetworkEventActor { } pub fn add_request(&mut self, request: DevtoolsHttpRequest) { - self.request.url = request.url.as_str().to_owned(); + request.url.as_str().clone_into(&mut self.request.url); self.request.method = request.method.clone(); self.request.headers = request.headers.clone(); diff --git a/components/servo/lib.rs b/components/servo/lib.rs index a135fef1f63..65a9f44799d 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -135,7 +135,7 @@ mod media_platform { match GStreamerBackend::init_with_plugins( plugin_dir, - &gstreamer_plugins::GSTREAMER_PLUGINS, + gstreamer_plugins::GSTREAMER_PLUGINS, ) { Ok(b) => b, Err(e) => { diff --git a/ports/servoshell/desktop/events_loop.rs b/ports/servoshell/desktop/events_loop.rs index a1654193129..f3af6db1844 100644 --- a/ports/servoshell/desktop/events_loop.rs +++ b/ports/servoshell/desktop/events_loop.rs @@ -94,13 +94,14 @@ impl EventsLoop { } } - pub fn run_forever(self, mut callback: F) + pub fn run_forever(self, mut callback: F) where - F: FnMut( - winit::event::Event, - Option<&winit::event_loop::EventLoopWindowTarget>, - &mut ControlFlow, - ), + F: 'static + + FnMut( + winit::event::Event, + Option<&winit::event_loop::EventLoopWindowTarget>, + &mut ControlFlow, + ), { match self.0 { EventLoop::Winit(events_loop) => { diff --git a/ports/servoshell/desktop/minibrowser.rs b/ports/servoshell/desktop/minibrowser.rs index 4c25512a5b3..899f5f505db 100644 --- a/ports/servoshell/desktop/minibrowser.rs +++ b/ports/servoshell/desktop/minibrowser.rs @@ -173,7 +173,7 @@ impl Minibrowser { let _duration = context.run(window, |ctx| { // TODO: While in fullscreen add some way to mitigate the increased phishing risk // when not displaying the URL bar: https://github.com/servo/servo/issues/32443 - if !window.fullscreen().is_some() { + if window.fullscreen().is_none() { TopBottomPanel::top("toolbar").show(ctx, |ui| { ui.allocate_ui_with_layout( ui.available_size(),