Skip to content

Commit

Permalink
Fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
ids1024 committed Nov 16, 2023
1 parent 96389fa commit eb38e3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
21 changes: 8 additions & 13 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Msg> {
fn create_surface(&mut self, output: wl_output::WlOutput) -> Command<Msg> {
let id = self.next_surface_id();
self.layer_surfaces.insert(
id,
Expand Down Expand Up @@ -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::<Vec<_>>(),
);
self.update_capture_filter();
Expand Down Expand Up @@ -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());
}
}
}
Expand Down Expand Up @@ -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 => {
Expand Down Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions src/wayland/dmabuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit eb38e3c

Please sign in to comment.