diff options
author | stuebinm | 2022-01-23 23:17:25 +0100 |
---|---|---|
committer | stuebinm | 2022-01-23 23:17:25 +0100 |
commit | 5200c5aa1bdd9b6c5ef6f1feecf6c5b3ecd0fdd2 (patch) | |
tree | 7bbc0591ec066c948b7c08a561f3e9055ab84b0c /src/event.rs | |
parent | be71912380176043a49a90487e9ce8e5a2d61d45 (diff) |
display calendar names alongside events
Diffstat (limited to 'src/event.rs')
-rw-r--r-- | src/event.rs | 7 |
1 files changed, 6 insertions, 1 deletions
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<String>) -> 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() + } }; } |