From eb38e3c3ba3ecc76d28da047ff9ef2734cf916ce Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Thu, 16 Nov 2023 13:42:19 -0800 Subject: [PATCH] Fix lints --- src/main.rs | 21 ++++++++------------- src/wayland/dmabuf.rs | 1 + 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1cb7e9e..601741f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -159,12 +159,7 @@ impl App { self.toplevels.iter_mut().find(|i| &i.handle == handle) } - fn create_surface( - &mut self, - output: wl_output::WlOutput, - width: i32, - height: i32, - ) -> Command { + fn create_surface(&mut self, output: wl_output::WlOutput) -> Command { let id = self.next_surface_id(); self.layer_surfaces.insert( id, @@ -213,7 +208,7 @@ impl App { let cmd = Command::batch( outputs .into_iter() - .map(|output| self.create_surface(output.handle, output.width, output.height)) + .map(|output| self.create_surface(output.handle)) .collect::>(), ); self.update_capture_filter(); @@ -294,7 +289,7 @@ impl Application for App { height, }); if self.visible { - return self.create_surface(output.clone(), width, height); + return self.create_surface(output.clone()); } } } @@ -455,10 +450,10 @@ impl Application for App { } Msg::DndWorkspaceEnter(action, mimes, (_x, _y)) => { if mimes.iter().any(|x| x == WORKSPACE_MIME) && action == DndAction::Move { - let mut cmds = Vec::new(); - cmds.push(set_actions(DndAction::Move, DndAction::Move)); - cmds.push(accept_mime_type(Some(WORKSPACE_MIME.to_string()))); - return Command::batch(cmds); + return Command::batch(vec![ + set_actions(DndAction::Move, DndAction::Move), + accept_mime_type(Some(WORKSPACE_MIME.to_string())), + ]); } } Msg::DndWorkspaceLeave => { @@ -503,7 +498,7 @@ impl Application for App { match drag_surface { DragSurface::Workspace { output, name } => { if let Some(workspace) = self.workspaces.iter().find(|x| &x.name == name) { - let item = workspace_item(workspace, &output); + let item = workspace_item(workspace, output); return widget::container(item) .height(iced::Length::Fixed(size.height)) .width(iced::Length::Fixed(size.width)) diff --git a/src/wayland/dmabuf.rs b/src/wayland/dmabuf.rs index feb0a73..27cd85f 100644 --- a/src/wayland/dmabuf.rs +++ b/src/wayland/dmabuf.rs @@ -27,6 +27,7 @@ impl DmabufHandler for AppData { feedback: DmabufFeedback, ) { if self.gbm.is_none() { + #[allow(clippy::unnecessary_cast)] match find_gbm_device(feedback.main_device() as u64) { Ok(Some(gbm)) => { self.gbm = Some(gbm);