summaryrefslogtreecommitdiffstats
path: root/src/util.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-04-16 20:04:57 +0200
committerMarkus Unterwaditzer <markus@unterwaditzer.net>2018-04-16 20:04:57 +0200
commit034710fe9784836a3dde5060d13fd99e31e322fc (patch)
tree29b39efb1cc1f662f0854f1c48a3064a0efb29d2 /src/util.rs
parent05c58c3b3c68baf982cbd058b5bd2865296c56f6 (diff)
Rewrite icalendar API for nice builder pattern style building of objects (#22)
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/util.rs b/src/util.rs
index f414ed7..6802e69 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -45,54 +45,6 @@ macro_rules! create_data_type {
}
}
-macro_rules! make_builder_fn {
- (
- fn $fnname:ident building $property_name:tt with_params,
- $mapfn:expr => $( $arg_name:ident : $arg_type:ty ),*
- ) => {
- pub fn $fnname(mut self, params: $crate::param::Parameters, $( $arg_name : $arg_type ),*) -> Self {
- let raw_value = vec![ $( $arg_name ),* ]
- .into_iter()
- .map($mapfn)
- .collect::<Vec<_>>()
- .join(";");
-
- let prop = Property {
- name: String::from($property_name),
- params: params,
- raw_value: raw_value,
- prop_group: None
- };
-
- self.0.props.entry(String::from($property_name)).or_insert(vec![]).push(prop);
- self
- }
- };
-
- (
- fn $fnname:ident building $property_name:tt,
- $mapfn:expr => $( $arg_name:ident : $arg_type:ty ),*
- ) => {
- pub fn $fnname(mut self, $( $arg_name : $arg_type ),*) -> Self {
- let raw_value = vec![ $( $arg_name ),* ]
- .into_iter()
- .map($mapfn)
- .collect::<Vec<_>>()
- .join(";");
-
-
- let prop = Property {
- name: String::from($property_name),
- params: BTreeMap::new(),
- raw_value: raw_value,
- prop_group: None
- };
- self.0.props.entry(String::from($property_name)).or_insert(vec![]).push(prop);
- self
- }
- }
-}
-
#[cfg(feature = "timeconversions")]
pub const DATE_TIME_FMT : &'static str = "%Y%m%dT%H%M%SZ";