mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-26 13:31:02 +00:00
Don't unwrap()
This commit is contained in:
parent
9d012c8f3c
commit
ee6064eee8
1 changed files with 3 additions and 1 deletions
|
@ -100,7 +100,9 @@ macro_rules! render {
|
|||
}
|
||||
|
||||
pub fn translate_notification(ctx: BaseContext<'_>, notif: Notification) -> String {
|
||||
let name = notif.get_actor(ctx.0).unwrap().name();
|
||||
let name = notif
|
||||
.get_actor(ctx.0)
|
||||
.map_or_else(|_| i18n!(ctx.1, "Someone"), |user| user.name());
|
||||
match notif.kind.as_ref() {
|
||||
notification_kind::COMMENT => i18n!(ctx.1, "{0} commented on your article."; &name),
|
||||
notification_kind::FOLLOW => i18n!(ctx.1, "{0} is subscribed to you."; &name),
|
||||
|
|
Loading…
Reference in a new issue