From d2fe9bf6fec3c273a785813ccf915816f8486d46 Mon Sep 17 00:00:00 2001 From: Fredrik Meringdal Date: Sat, 17 Oct 2020 01:56:39 +0200 Subject: some small fixes --- src/iter.rs | 4 +++- src/iterinfo.rs | 2 +- src/options.rs | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/iter.rs b/src/iter.rs index 0581cc3..2673059 100644 --- a/src/iter.rs +++ b/src/iter.rs @@ -249,7 +249,9 @@ pub fn increment_counter_date( counter_date + Duration::days(day_delta as i64) } Frequenzy::DAILY => counter_date + Duration::days(options.interval as i64), - _ => panic!("hfoashfosa"), + Frequenzy::HOURLY => counter_date + Duration::hours(options.interval as i64), + Frequenzy::MINUTELY => counter_date + Duration::minutes(options.interval as i64), + Frequenzy::SECONDLY => counter_date + Duration::seconds(options.interval as i64), } } diff --git a/src/iterinfo.rs b/src/iterinfo.rs index dbc6e24..083d4fa 100644 --- a/src/iterinfo.rs +++ b/src/iterinfo.rs @@ -219,7 +219,7 @@ impl<'a> IterInfo<'a> { Frequenzy::MONTHLY => self.mdayset(month), Frequenzy::WEEKLY => self.wdayset(year, month, day), Frequenzy::DAILY => self.ddayset(year, month, day), - _ => panic!("Invalid freq"), + _ => self.ddayset(year, month, day), } } diff --git a/src/options.rs b/src/options.rs index 7b2a01e..30143c1 100644 --- a/src/options.rs +++ b/src/options.rs @@ -1,4 +1,3 @@ - use chrono::prelude::*; #[derive(Debug)] -- cgit v1.2.3