Fix clippy warnings
This commit is contained in:
parent
dfa2580bdc
commit
120b45b972
2 changed files with 7 additions and 6 deletions
|
@ -67,7 +67,7 @@ impl Compositor {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/// abstract 'sending back workspace change events'
|
/// abstract 'sending back workspace change events'
|
||||||
pub (self) struct EventSender {
|
struct EventSender {
|
||||||
tx: Sender<WorkspaceVisible>,
|
tx: Sender<WorkspaceVisible>,
|
||||||
waker: Arc<Waker>,
|
waker: Arc<Waker>,
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,8 @@ impl EventSender {
|
||||||
self.waker.wake().unwrap();
|
self.waker.wake().unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub (self) trait CompositorInterface: Send + Sync {
|
|
||||||
|
trait CompositorInterface: Send + Sync {
|
||||||
fn request_visible_workspaces(&mut self) -> Vec<WorkspaceVisible>;
|
fn request_visible_workspaces(&mut self) -> Vec<WorkspaceVisible>;
|
||||||
fn subscribe_event_loop(self, event_sender: EventSender);
|
fn subscribe_event_loop(self, event_sender: EventSender);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,14 +32,14 @@ impl CompositorInterface for NiriConnectionTask {
|
||||||
.expect("failed to connect to niri socket")
|
.expect("failed to connect to niri socket")
|
||||||
.send(Request::Workspaces)
|
.send(Request::Workspaces)
|
||||||
{
|
{
|
||||||
return workspaces
|
workspaces
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|w| w.is_active)
|
.filter(|w| w.is_active)
|
||||||
.map(|workspace| WorkspaceVisible {
|
.map(|workspace| WorkspaceVisible {
|
||||||
output: workspace.output.unwrap_or_else(String::new),
|
output: workspace.output.unwrap_or_default(),
|
||||||
workspace_name: workspace.name.unwrap_or_else(String::new),
|
workspace_name: workspace.name.unwrap_or_default(),
|
||||||
})
|
})
|
||||||
.collect();
|
.collect()
|
||||||
} else {
|
} else {
|
||||||
panic!("unable to retrieve niri workspaces")
|
panic!("unable to retrieve niri workspaces")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue