From 1e51c830679d8009d246a0e3add113d472af4ede Mon Sep 17 00:00:00 2001 From: candifloss Date: Fri, 27 Sep 2024 23:56:53 +0530 Subject: [PATCH] minor fixes --- Cargo.toml | 2 +- src/formats/rson.rs | 5 +++-- src/formats/serde.rs | 4 ++-- src/main.rs | 2 +- src/notification.rs | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5e6d566..8abf818 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snot" -version = "0.1.1" +version = "0.1.3" edition = "2021" authors = ["candifloss "] diff --git a/src/formats/rson.rs b/src/formats/rson.rs index fd4027d..8f03db6 100644 --- a/src/formats/rson.rs +++ b/src/formats/rson.rs @@ -1,10 +1,11 @@ // This module deals with converting the notification object into rson format, which can be used instead of json if preferred use crate::notification::Notification; -use rson_rs::ser::to_string as rson_string; use rson_rs::de::Error as RsonError; +use rson_rs::ser::to_string as rson_string; impl Notification { pub fn rson(&self) -> Result { - rson_string(self).map_err(|e| RsonError::Message(format!("RSON serialization error: {}", e))) + rson_string(self) + .map_err(|e| RsonError::Message(format!("RSON serialization error: {}", e))) } } diff --git a/src/formats/serde.rs b/src/formats/serde.rs index 489841c..66bf771 100644 --- a/src/formats/serde.rs +++ b/src/formats/serde.rs @@ -1,6 +1,6 @@ use serde::{Serialize, Serializer}; use std::collections::HashMap; -use zvariant::OwnedValue; +use zvariant::OwnedValue; //use std::hash::BuildHasher; use serde::ser::SerializeMap; @@ -60,4 +60,4 @@ where map.serialize(serializer) } -*/ \ No newline at end of file +*/ diff --git a/src/main.rs b/src/main.rs index bdf9847..edcf5a3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,7 @@ use zbus::{message::Body, Connection, Result}; const SERVER_NAME: &str = "SNot"; // Server software name const VENDOR: &str = "candifloss.cc"; // Server software vendor -const VERSION: &str = "0.1.2"; // Server software version +const VERSION: &str = env!("CARGO_PKG_VERSION"); // Server software version, from Cargo.toml const SPEC_VERSION: &str = "0.42"; // DBus specification version const NOTIF_INTERFACE: &str = "org.freedesktop.Notifications"; // DBus interface name diff --git a/src/notification.rs b/src/notification.rs index d278c31..4c56bec 100644 --- a/src/notification.rs +++ b/src/notification.rs @@ -1,4 +1,4 @@ -use crate::formats::serde::serialize_actions;//,serialize_hints}; +use crate::formats::serde::serialize_actions; //,serialize_hints}; use serde::Serialize; use std::collections::HashMap; use zbus::{message::Body, Result};