Make Hints directly deserializable

This commit is contained in:
Ian Douglas Scott 2022-01-13 15:09:57 -08:00
parent fdf36c4a66
commit deb72c42af

View file

@ -111,7 +111,7 @@ impl NotificationsInterface {
summary: String, summary: String,
body: String, body: String,
actions: Vec<String>, actions: Vec<String>,
hints: HashMap<String, OwnedValue>, hints: Hints,
expire_timeout: i32, expire_timeout: i32,
) -> u32 { ) -> u32 {
u32::from(self.handle_notify( u32::from(self.handle_notify(
@ -121,7 +121,7 @@ impl NotificationsInterface {
summary, summary,
body, body,
actions, actions,
Hints(hints), hints,
expire_timeout, expire_timeout,
)) ))
} }
@ -191,6 +191,7 @@ glib::wrapper! {
pub struct Notifications(ObjectSubclass<NotificationsInner>); pub struct Notifications(ObjectSubclass<NotificationsInner>);
} }
#[derive(zvariant::Type, serde::Deserialize)]
struct Hints(HashMap<String, OwnedValue>); struct Hints(HashMap<String, OwnedValue>);
#[allow(dead_code)] #[allow(dead_code)]