mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-03 19:51:03 +02:00
refactor: various changes based on rust 1.65 clippy
This commit is contained in:
parent
c48029664d
commit
ff17ec1996
7 changed files with 59 additions and 64 deletions
|
@ -81,18 +81,20 @@ impl Module<gtk::Box> for LauncherModule {
|
|||
tx: Sender<ModuleUpdateEvent<Self::SendMessage>>,
|
||||
mut rx: Receiver<Self::ReceiveMessage>,
|
||||
) -> crate::Result<()> {
|
||||
let items = match &self.favorites {
|
||||
Some(favorites) => favorites
|
||||
.iter()
|
||||
.map(|app_id| {
|
||||
(
|
||||
app_id.to_string(),
|
||||
Item::new(app_id.to_string(), OpenState::Closed, true),
|
||||
)
|
||||
})
|
||||
.collect::<IndexMap<_, _>>(),
|
||||
None => IndexMap::new(),
|
||||
};
|
||||
let items = self
|
||||
.favorites
|
||||
.as_ref()
|
||||
.map_or_else(IndexMap::new, |favorites| {
|
||||
favorites
|
||||
.iter()
|
||||
.map(|app_id| {
|
||||
(
|
||||
app_id.to_string(),
|
||||
Item::new(app_id.to_string(), OpenState::Closed, true),
|
||||
)
|
||||
})
|
||||
.collect::<IndexMap<_, _>>()
|
||||
});
|
||||
|
||||
let items = Arc::new(Mutex::new(items));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue