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,
body: String,
actions: Vec<String>,
hints: HashMap<String, OwnedValue>,
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<NotificationsInner>);
}
#[derive(zvariant::Type, serde::Deserialize)]
struct Hints(HashMap<String, OwnedValue>);
#[allow(dead_code)]