From deb72c42af6c9493243395c70dfb9400a5cac6e5 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Thu, 13 Jan 2022 15:09:57 -0800 Subject: [PATCH] Make `Hints` directly deserializable --- src/notifications.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/notifications.rs b/src/notifications.rs index ed0b3a67..c3bf4f87 100644 --- a/src/notifications.rs +++ b/src/notifications.rs @@ -111,7 +111,7 @@ impl NotificationsInterface { summary: String, body: String, actions: Vec, - hints: HashMap, + hints: Hints, expire_timeout: i32, ) -> u32 { u32::from(self.handle_notify( @@ -121,7 +121,7 @@ impl NotificationsInterface { summary, body, actions, - Hints(hints), + hints, expire_timeout, )) } @@ -191,6 +191,7 @@ glib::wrapper! { pub struct Notifications(ObjectSubclass); } +#[derive(zvariant::Type, serde::Deserialize)] struct Hints(HashMap); #[allow(dead_code)]