mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-17 15:59:25 +00:00
Some refactoring and app token management
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use super::{CalDateTime, EventObject, JournalObject, TodoObject};
|
||||
use crate::Error;
|
||||
use ical::parser::{ical::component::IcalTimeZone, Component};
|
||||
use ical::parser::{Component, ical::component::IcalTimeZone};
|
||||
use serde::Serialize;
|
||||
use sha2::{Digest, Sha256};
|
||||
use std::{collections::HashMap, io::BufReader};
|
||||
@@ -13,14 +13,19 @@ pub enum CalendarObjectType {
|
||||
Journal = 2,
|
||||
}
|
||||
|
||||
impl rustical_xml::ValueSerialize for CalendarObjectType {
|
||||
fn serialize(&self) -> String {
|
||||
impl CalendarObjectType {
|
||||
pub fn as_str(&self) -> &'static str {
|
||||
match self {
|
||||
CalendarObjectType::Event => "VEVENT",
|
||||
CalendarObjectType::Todo => "VTODO",
|
||||
CalendarObjectType::Journal => "VJOURNAL",
|
||||
}
|
||||
.to_owned()
|
||||
}
|
||||
}
|
||||
|
||||
impl rustical_xml::ValueSerialize for CalendarObjectType {
|
||||
fn serialize(&self) -> String {
|
||||
self.as_str().to_owned()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user