[minor] Fixed case for an enum

This commit is contained in:
daladim 2021-02-24 17:22:38 +01:00
parent 7e3bccb5ad
commit 5e6eb6863c

View file

@ -11,9 +11,9 @@ use bitflags::bitflags;
bitflags! { bitflags! {
pub struct SupportedComponents: u8 { pub struct SupportedComponents: u8 {
/// An event, such as a calendar meeting /// An event, such as a calendar meeting
const Event = 1; const EVENT = 1;
/// A to-do item, such as a reminder /// A to-do item, such as a reminder
const Todo = 2; const TODO = 2;
} }
} }
@ -30,8 +30,8 @@ impl TryFrom<minidom::Element> for SupportedComponents {
for child in element.children() { for child in element.children() {
match child.attr("name") { match child.attr("name") {
None => continue, None => continue,
Some("VEVENT") => flags.insert(Self::Event), Some("VEVENT") => flags.insert(Self::EVENT),
Some("VTODO") => flags.insert(Self::Todo), Some("VTODO") => flags.insert(Self::TODO),
Some(other) => { Some(other) => {
log::warn!("Unimplemented supported component type: {:?}. Ignoring it", other); log::warn!("Unimplemented supported component type: {:?}. Ignoring it", other);
continue continue
@ -72,7 +72,7 @@ impl Calendar {
/// Returns whether this calDAV calendar supports to-do items /// Returns whether this calDAV calendar supports to-do items
pub fn supports_todo(&self) -> bool { pub fn supports_todo(&self) -> bool {
self.supported_components.contains(SupportedComponents::Todo) self.supported_components.contains(SupportedComponents::TODO)
} }
pub fn tasks(&self) -> Vec<&Task> { pub fn tasks(&self) -> Vec<&Task> {