some refactoring

This commit is contained in:
Lennart
2025-01-01 15:22:51 +01:00
parent 646919587e
commit 40c8624703
6 changed files with 49 additions and 65 deletions

View File

@@ -1,9 +1,10 @@
use derive_more::derive::From;
use rustical_xml::{XmlDeserialize, XmlSerialize};
#[derive(Debug, Clone, XmlDeserialize, XmlSerialize, PartialEq)]
#[derive(Debug, Clone, XmlDeserialize, XmlSerialize, PartialEq, From)]
pub struct SupportedCalendarComponent {
#[xml(ty = "attr")]
pub name: String,
pub name: &'static str,
}
#[derive(Debug, Clone, XmlDeserialize, XmlSerialize, PartialEq)]
@@ -12,6 +13,14 @@ pub struct SupportedCalendarComponentSet {
pub comp: Vec<SupportedCalendarComponent>,
}
impl Default for SupportedCalendarComponentSet {
fn default() -> Self {
Self {
comp: vec!["VEVENT".into(), "VTODO".into(), "VJOURNAL".into()],
}
}
}
#[derive(Debug, Clone, XmlSerialize, PartialEq)]
pub struct CalendarData {
#[xml(ty = "attr")]