Fix lints

This commit is contained in:
Ian Douglas Scott 2023-11-16 13:42:19 -08:00
parent 96389fa999
commit eb38e3c3ba
2 changed files with 9 additions and 13 deletions

View file

@ -159,12 +159,7 @@ impl App {
self.toplevels.iter_mut().find(|i| &i.handle == handle) self.toplevels.iter_mut().find(|i| &i.handle == handle)
} }
fn create_surface( fn create_surface(&mut self, output: wl_output::WlOutput) -> Command<Msg> {
&mut self,
output: wl_output::WlOutput,
width: i32,
height: i32,
) -> Command<Msg> {
let id = self.next_surface_id(); let id = self.next_surface_id();
self.layer_surfaces.insert( self.layer_surfaces.insert(
id, id,
@ -213,7 +208,7 @@ impl App {
let cmd = Command::batch( let cmd = Command::batch(
outputs outputs
.into_iter() .into_iter()
.map(|output| self.create_surface(output.handle, output.width, output.height)) .map(|output| self.create_surface(output.handle))
.collect::<Vec<_>>(), .collect::<Vec<_>>(),
); );
self.update_capture_filter(); self.update_capture_filter();
@ -294,7 +289,7 @@ impl Application for App {
height, height,
}); });
if self.visible { 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)) => { Msg::DndWorkspaceEnter(action, mimes, (_x, _y)) => {
if mimes.iter().any(|x| x == WORKSPACE_MIME) && action == DndAction::Move { if mimes.iter().any(|x| x == WORKSPACE_MIME) && action == DndAction::Move {
let mut cmds = Vec::new(); return Command::batch(vec![
cmds.push(set_actions(DndAction::Move, DndAction::Move)); set_actions(DndAction::Move, DndAction::Move),
cmds.push(accept_mime_type(Some(WORKSPACE_MIME.to_string()))); accept_mime_type(Some(WORKSPACE_MIME.to_string())),
return Command::batch(cmds); ]);
} }
} }
Msg::DndWorkspaceLeave => { Msg::DndWorkspaceLeave => {
@ -503,7 +498,7 @@ impl Application for App {
match drag_surface { match drag_surface {
DragSurface::Workspace { output, name } => { DragSurface::Workspace { output, name } => {
if let Some(workspace) = self.workspaces.iter().find(|x| &x.name == 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) return widget::container(item)
.height(iced::Length::Fixed(size.height)) .height(iced::Length::Fixed(size.height))
.width(iced::Length::Fixed(size.width)) .width(iced::Length::Fixed(size.width))

View file

@ -27,6 +27,7 @@ impl DmabufHandler for AppData {
feedback: DmabufFeedback, feedback: DmabufFeedback,
) { ) {
if self.gbm.is_none() { if self.gbm.is_none() {
#[allow(clippy::unnecessary_cast)]
match find_gbm_device(feedback.main_device() as u64) { match find_gbm_device(feedback.main_device() as u64) {
Ok(Some(gbm)) => { Ok(Some(gbm)) => {
self.gbm = Some(gbm); self.gbm = Some(gbm);