From b5e3b6ae305cd3c3be952b154759764a8e5adbb8 Mon Sep 17 00:00:00 2001 From: ShootingStarDragons Date: Wed, 14 Aug 2024 16:45:27 +0859 Subject: [PATCH] chore: add panic for shit code --- lala_bar/src/main.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lala_bar/src/main.rs b/lala_bar/src/main.rs index 22a52af..d14778d 100644 --- a/lala_bar/src/main.rs +++ b/lala_bar/src/main.rs @@ -587,10 +587,13 @@ impl MultiApplication for LalaMusicBar { return Some(LaLaInfo::Notify(Box::new(info.clone()))); } let notify_id = self.showned_notifications.get(&id)?; - self.notifications - .get(notify_id) - .cloned() - .map(|notifyw| LaLaInfo::Notify(Box::new(notifyw))) + Some( + self.notifications + .get(notify_id) + .cloned() + .map(|notifyw| LaLaInfo::Notify(Box::new(notifyw))) + .expect(format!("it should can be found, {notify_id} is missing, please check the code!!").as_str()), + ) } }