From e09362cd3cd00b7d7818dbc25d4a1525e652c7dd Mon Sep 17 00:00:00 2001 From: Mercy Bassey <57226464+mercybassey@users.noreply.github.com> Date: Fri, 11 Oct 2024 18:23:38 +0100 Subject: [PATCH] clippy: Fix issues in `components/fonts` and `ports/servoshell` (#33809) * fix linting issues Signed-off-by: mercybassey adding '-s' * Remove a pair of unecessary parenethesis Signed-off-by: Martin Robinson --------- Signed-off-by: Martin Robinson Co-authored-by: Martin Robinson --- components/fonts/lib.rs | 2 +- components/fonts/platform/freetype/mod.rs | 2 +- ports/servoshell/desktop/app.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/fonts/lib.rs b/components/fonts/lib.rs index b6954e35cd2..1b48ef1f953 100644 --- a/components/fonts/lib.rs +++ b/components/fonts/lib.rs @@ -45,7 +45,7 @@ impl FontData { impl AsRef<[u8]> for FontData { fn as_ref(&self) -> &[u8] { - &**self.0 + &self.0 } } diff --git a/components/fonts/platform/freetype/mod.rs b/components/fonts/platform/freetype/mod.rs index e0a0a5967d6..1ec918728cc 100644 --- a/components/fonts/platform/freetype/mod.rs +++ b/components/fonts/platform/freetype/mod.rs @@ -69,6 +69,6 @@ impl LocalFontIdentifier { pub(crate) fn read_data_from_file(&self) -> Option> { let file = File::open(Path::new(&*self.path)).ok()?; let mmap = unsafe { Mmap::map(&file).ok()? }; - Some((&mmap[..]).to_vec()) + Some(mmap[..].to_vec()) } } diff --git a/ports/servoshell/desktop/app.rs b/ports/servoshell/desktop/app.rs index 0d72a42348f..49b4ac593f8 100644 --- a/ports/servoshell/desktop/app.rs +++ b/ports/servoshell/desktop/app.rs @@ -80,7 +80,7 @@ impl App { } else { Rc::new(headed_window::Window::new( opts::get().initial_window_size, - &events_loop.as_winit(), + events_loop.as_winit(), no_native_titlebar, device_pixel_ratio_override, )) @@ -118,7 +118,7 @@ impl App { app.minibrowser = Some( Minibrowser::new( &rendering_context, - &events_loop.as_winit(), + events_loop.as_winit(), initial_url.clone(), ) .into(),