diff options
author | Fredrik Meringdal <fmeringdal@hotmail.com> | 2020-10-26 20:21:57 +0100 |
---|---|---|
committer | Fredrik Meringdal <fmeringdal@hotmail.com> | 2020-10-26 20:21:57 +0100 |
commit | 5394f1c753b2752fc9d6409088f0658c797286d6 (patch) | |
tree | edef5c6a8700b8afd579fe31163614f1ec948395 /src/parse_options.rs | |
parent | 0bbc006982cb88d53147bfaec9e1f466caaf5043 (diff) | |
download | rust_rrule-5394f1c753b2752fc9d6409088f0658c797286d6.zip |
timezones
Diffstat (limited to 'src/parse_options.rs')
-rw-r--r-- | src/parse_options.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/parse_options.rs b/src/parse_options.rs index b7926ef..41208b6 100644 --- a/src/parse_options.rs +++ b/src/parse_options.rs @@ -10,7 +10,7 @@ pub fn parse_options(options: &PartialOptions) -> ParsedOptions { default_partial_options.wkst = Some(0); let tzid: Tz = if options.tzid.is_some() { - options.tzid.clone().unwrap().parse().unwrap() + options.tzid.clone().unwrap() } else { UTC }; @@ -23,7 +23,7 @@ pub fn parse_options(options: &PartialOptions) -> ParsedOptions { let freq = partial_options.freq.unwrap(); if partial_options.dtstart.is_none() { - partial_options.dtstart = Some(Utc::now()); + panic!("Dtstart can not be None"); } if partial_options.wkst.is_none() { @@ -38,7 +38,6 @@ pub fn parse_options(options: &PartialOptions) -> ParsedOptions { } } - if !( partial_options.byweekno.is_some() || is_some_and_not_empty(&partial_options.byweekno) || @@ -61,7 +60,7 @@ pub fn parse_options(options: &PartialOptions) -> ParsedOptions { Frequenzy::Weekly => { partial_options.byweekday = Some(vec![partial_options.dtstart.unwrap().weekday() as usize]); }, - _ => unreachable!("Shouldnt be reached") + _ => () }; } |