chore: clippy

This commit is contained in:
Vukašin Vojinović 2025-10-16 13:50:32 +02:00 committed by Victoria Brekenfeld
parent 3b70bc0265
commit 0847247c33
77 changed files with 865 additions and 1029 deletions

View file

@ -252,10 +252,7 @@ where
_dh: &DisplayHandle,
_data_init: &mut DataInit<'_, D>,
) {
match request {
zcosmic_toplevel_handle_v1::Request::Destroy => {}
_ => {}
}
if let zcosmic_toplevel_handle_v1::Request::Destroy = request {}
}
fn destroyed(
@ -290,7 +287,7 @@ pub fn toplevel_leave_output(toplevel: &impl Window, output: &Output) {
pub fn toplevel_enter_workspace(toplevel: &impl Window, workspace: &WorkspaceHandle) {
if let Some(state) = toplevel.user_data().get::<ToplevelState>() {
state.lock().unwrap().workspaces.push(workspace.clone());
state.lock().unwrap().workspaces.push(*workspace);
}
}
@ -509,7 +506,7 @@ where
changed = true;
}
if handle_state.states.as_ref().map_or(true, |states| {
if handle_state.states.as_ref().is_none_or(|states| {
(states.contains(&States::Maximized) != window.is_maximized())
|| (states.contains(&States::Fullscreen) != window.is_fullscreen())
|| (states.contains(&States::Activated) != window.is_activated())
@ -562,7 +559,7 @@ where
.geometry
.filter(|_| instance.version() >= zcosmic_toplevel_handle_v1::EVT_GEOMETRY_SINCE)
.filter(|geo| output.geometry().intersection(*geo).is_some())
.map(|geo| geo.to_local(&output));
.map(|geo| geo.to_local(output));
for wl_output in output.client_outputs(&client) {
if handle_state.wl_outputs.insert(wl_output.clone()) {
instance.output_enter(&wl_output);
@ -584,7 +581,7 @@ where
.iter()
.any(|output| output.owns(wl_output));
if !retain {
instance.output_leave(&wl_output);
instance.output_leave(wl_output);
changed = true;
}
retain
@ -596,8 +593,8 @@ where
.iter()
.filter(|w| !handle_state.workspaces.contains(w))
{
for handle in workspace_state.raw_ext_workspace_handles(&new_workspace, &instance.id()) {
instance.ext_workspace_enter(&handle);
for handle in workspace_state.raw_ext_workspace_handles(new_workspace, &instance.id()) {
instance.ext_workspace_enter(handle);
changed = true;
}
}
@ -606,8 +603,8 @@ where
.iter()
.filter(|w| !state.workspaces.contains(w))
{
for handle in workspace_state.raw_ext_workspace_handles(&old_workspace, &instance.id()) {
instance.ext_workspace_leave(&handle);
for handle in workspace_state.raw_ext_workspace_handles(old_workspace, &instance.id()) {
instance.ext_workspace_leave(handle);
changed = true;
}
}