From 5200c5aa1bdd9b6c5ef6f1feecf6c5b3ecd0fdd2 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sun, 23 Jan 2022 23:17:25 +0100 Subject: display calendar names alongside events --- src/event.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/event.rs') diff --git a/src/event.rs b/src/event.rs index e8cfceb..f58519a 100644 --- a/src/event.rs +++ b/src/event.rs @@ -16,6 +16,7 @@ pub struct Event { pub location: String, pub description: String, pub status: Status, + pub calendar: String } #[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Eq)] @@ -33,7 +34,7 @@ pub enum End { impl Event { - pub fn new() -> Event { + pub fn new(calendar: &Option) -> Event { return Event { summary: "".to_string(), location: "".to_string(), @@ -41,6 +42,10 @@ impl Event { status: Status::Confirmed, start: Date::new(), end: End::Date(Date::new()), + calendar: match calendar { + None => "[unknown calendar]".to_string(), + Some(a) => a.to_string() + } }; } -- cgit v1.2.3