mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-14 08:51:29 +03:00
use slab instead of reinventing the wheel (#112)
This commit is contained in:
committed by
GitHub
parent
279e582698
commit
3e96b42067
@@ -87,8 +87,8 @@ impl Window {
|
||||
row
|
||||
}
|
||||
|
||||
pub fn new_client(&self, client: Client, active: bool) {
|
||||
let client = ClientObject::new(client, active);
|
||||
pub fn new_client(&self, handle: ClientHandle, client: Client, active: bool) {
|
||||
let client = ClientObject::new(handle, client, active);
|
||||
self.clients().append(&client);
|
||||
self.set_placeholder_visible(false);
|
||||
}
|
||||
@@ -115,9 +115,9 @@ impl Window {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update_client(&self, client: Client) {
|
||||
let Some(idx) = self.client_idx(client.handle) else {
|
||||
log::warn!("could not find client with handle {}", client.handle);
|
||||
pub fn update_client(&self, handle: ClientHandle, client: Client) {
|
||||
let Some(idx) = self.client_idx(handle) else {
|
||||
log::warn!("could not find client with handle {}", handle);
|
||||
return;
|
||||
};
|
||||
let client_object = self.clients().item(idx as u32).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user