From 5394f1c753b2752fc9d6409088f0658c797286d6 Mon Sep 17 00:00:00 2001 From: Fredrik Meringdal Date: Mon, 26 Oct 2020 20:21:57 +0100 Subject: timezones --- src/parse_options.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/parse_options.rs') 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") + _ => () }; } -- cgit v1.2.3