Skip to content

Commit

Permalink
fix: clippy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Decodetalkers committed Aug 14, 2024
1 parent 518c8cc commit 7382b4b
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lala_bar/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ impl LalaMusicBar {
fn hidden_notifications(&self) -> impl Iterator<Item = &NotifyUnitWidgetInfo> {
let mut hiddened: Vec<&NotifyUnitWidgetInfo> = self
.notifications
.iter()
.map(|(_, info)| info)
.values()
.filter(|info| info.counter >= MAX_SHOWN_NOTIFICATIONS_COUNT || self.quite_mode)
.collect();
hiddened.sort_by(|a, b| a.counter.partial_cmp(&b.counter).unwrap());
Expand Down Expand Up @@ -575,7 +574,7 @@ impl MultiApplication for LalaMusicBar {
} else {
let notify_id = self.showned_notifications.get(&id)?;
self.notifications
.get(&notify_id)
.get(notify_id)
.cloned()
.map(|notifyw| LaLaInfo::Notify(Box::new(notifyw)))
}
Expand Down Expand Up @@ -900,11 +899,10 @@ impl MultiApplication for LalaMusicBar {
}
if !self.quite_mode
&& notify.counter == MAX_SHOWN_NOTIFICATIONS_COUNT - 1
&& self
&& !self
.showned_notifications
.iter()
.find(|(_, v)| notify.unit.id == v)
.is_none()
.any(|(_, v)| &notify.unit.id == v)
{
commands.push(Command::single(
LaLaShellIdAction::new(
Expand Down Expand Up @@ -1003,7 +1001,7 @@ impl MultiApplication for LalaMusicBar {
let Some(notify_id) = self.showned_notifications.get(&id) else {
return Command::none();
};
let notify = self.notifications.get_mut(&notify_id).unwrap();
let notify = self.notifications.get_mut(notify_id).unwrap();
notify.inline_reply = msg;
}
Message::ClearAllNotifications => {
Expand Down Expand Up @@ -1036,7 +1034,7 @@ impl MultiApplication for LalaMusicBar {

let notify = &unitwidgetinfo.unit;
let realid = self.showned_notifications.get(&id).unwrap();
let notifywidget = self.notifications.get(&realid).unwrap();
let notifywidget = self.notifications.get(realid).unwrap();
if notify.inline_reply_support() {
return column![
btnwidgets,
Expand Down

0 comments on commit 7382b4b

Please sign in to comment.