mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-17 23:01:04 +02:00
refactor: fix clippy warnings
This commit is contained in:
parent
10b3b01e5b
commit
1b35354272
4 changed files with 12 additions and 13 deletions
|
@ -74,7 +74,7 @@ impl Module<MenuBar> for TrayModule {
|
|||
|
||||
// listen to tray updates
|
||||
spawn(async move {
|
||||
for (key, (item, menu)) in initial_items.into_iter() {
|
||||
for (key, (item, menu)) in initial_items {
|
||||
send_async!(
|
||||
tx,
|
||||
ModuleUpdateEvent::Update(Event::Add(key.clone(), item.into()))
|
||||
|
@ -89,7 +89,7 @@ impl Module<MenuBar> for TrayModule {
|
|||
}
|
||||
|
||||
while let Ok(message) = tray_rx.recv().await {
|
||||
send_async!(tx, ModuleUpdateEvent::Update(message))
|
||||
send_async!(tx, ModuleUpdateEvent::Update(message));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -159,12 +159,11 @@ fn on_update(
|
|||
let mut menu_item = TrayMenu::new(tx.clone(), address.clone(), *item);
|
||||
container.add(&menu_item.widget);
|
||||
|
||||
match icon::get_image(&menu_item, icon_theme, icon_size, prefer_icons) {
|
||||
Ok(image) => menu_item.set_image(&image),
|
||||
Err(_) => {
|
||||
let label = menu_item.title.clone().unwrap_or(address.clone());
|
||||
menu_item.set_label(&label)
|
||||
}
|
||||
if let Ok(image) = icon::get_image(&menu_item, icon_theme, icon_size, prefer_icons) {
|
||||
menu_item.set_image(&image);
|
||||
} else {
|
||||
let label = menu_item.title.clone().unwrap_or(address.clone());
|
||||
menu_item.set_label(&label);
|
||||
};
|
||||
|
||||
menu_item.widget.show();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue