minor fixes

This commit is contained in:
Candifloss 2024-09-27 23:56:53 +05:30
parent 45bf3a87b9
commit 1e51c83067
5 changed files with 8 additions and 7 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "snot" name = "snot"
version = "0.1.1" version = "0.1.3"
edition = "2021" edition = "2021"
authors = ["candifloss <candifloss.cc>"] authors = ["candifloss <candifloss.cc>"]

View File

@ -1,10 +1,11 @@
// This module deals with converting the notification object into rson format, which can be used instead of json if preferred // 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 crate::notification::Notification;
use rson_rs::ser::to_string as rson_string;
use rson_rs::de::Error as RsonError; use rson_rs::de::Error as RsonError;
use rson_rs::ser::to_string as rson_string;
impl Notification { impl Notification {
pub fn rson(&self) -> Result<String, RsonError> { pub fn rson(&self) -> Result<String, RsonError> {
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)))
} }
} }

View File

@ -1,6 +1,6 @@
use serde::{Serialize, Serializer}; use serde::{Serialize, Serializer};
use std::collections::HashMap; use std::collections::HashMap;
use zvariant::OwnedValue; use zvariant::OwnedValue;
//use std::hash::BuildHasher; //use std::hash::BuildHasher;
use serde::ser::SerializeMap; use serde::ser::SerializeMap;
@ -60,4 +60,4 @@ where
map.serialize(serializer) map.serialize(serializer)
} }
*/ */

View File

@ -14,7 +14,7 @@ use zbus::{message::Body, Connection, Result};
const SERVER_NAME: &str = "SNot"; // Server software name const SERVER_NAME: &str = "SNot"; // Server software name
const VENDOR: &str = "candifloss.cc"; // Server software vendor 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 SPEC_VERSION: &str = "0.42"; // DBus specification version
const NOTIF_INTERFACE: &str = "org.freedesktop.Notifications"; // DBus interface name const NOTIF_INTERFACE: &str = "org.freedesktop.Notifications"; // DBus interface name

View File

@ -1,4 +1,4 @@
use crate::formats::serde::serialize_actions;//,serialize_hints}; use crate::formats::serde::serialize_actions; //,serialize_hints};
use serde::Serialize; use serde::Serialize;
use std::collections::HashMap; use std::collections::HashMap;
use zbus::{message::Body, Result}; use zbus::{message::Body, Result};