mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 14:02:29 +00:00
add tagname
This commit is contained in:
@@ -18,6 +18,7 @@ pub mod error;
|
|||||||
pub mod proptypes;
|
pub mod proptypes;
|
||||||
pub mod resources;
|
pub mod resources;
|
||||||
pub mod routes;
|
pub mod routes;
|
||||||
|
pub mod tagname;
|
||||||
|
|
||||||
pub struct CalDavContext<C: CalendarStore + ?Sized> {
|
pub struct CalDavContext<C: CalendarStore + ?Sized> {
|
||||||
pub prefix: String,
|
pub prefix: String,
|
||||||
|
|||||||
11
crates/caldav/src/tagname.rs
Normal file
11
crates/caldav/src/tagname.rs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
use strum::EnumProperty;
|
||||||
|
|
||||||
|
pub trait TagName {
|
||||||
|
fn tagname(self) -> &'static str;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<P: EnumProperty + Into<&'static str>> TagName for P {
|
||||||
|
fn tagname(self) -> &'static str {
|
||||||
|
self.get_str("tagname").unwrap_or(self.into())
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user