diff options
author | Fredrik Meringdal <fmeringdal@hotmail.com> | 2020-10-26 21:48:33 +0100 |
---|---|---|
committer | Fredrik Meringdal <fmeringdal@hotmail.com> | 2020-10-26 21:48:33 +0100 |
commit | 6fa125473b7d9e6931353a48c67a106f9becac9a (patch) | |
tree | 6012a17348b17a57b21ce8f9e2af9d1433a73bcd /src/parse_options.rs | |
parent | 5394f1c753b2752fc9d6409088f0658c797286d6 (diff) | |
download | rust_rrule-6fa125473b7d9e6931353a48c67a106f9becac9a.zip |
docs and examples
Diffstat (limited to 'src/parse_options.rs')
-rw-r--r-- | src/parse_options.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/parse_options.rs b/src/parse_options.rs index 41208b6..49b7550 100644 --- a/src/parse_options.rs +++ b/src/parse_options.rs @@ -1,21 +1,21 @@ use chrono::prelude::*; -use crate::options::{ParsedOptions, Frequenzy, PartialOptions}; +use crate::options::{ParsedOptions, Frequenzy, Options}; use chrono_tz::{Tz, UTC}; // TODO: Validation -pub fn parse_options(options: &PartialOptions) -> ParsedOptions { - let mut default_partial_options = PartialOptions::new(); +pub fn parse_options(options: &Options) -> ParsedOptions { + let mut default_partial_options = Options::new(); default_partial_options.interval = Some(1); default_partial_options.freq = Some(Frequenzy::Yearly); default_partial_options.wkst = Some(0); - + let tzid: Tz = if options.tzid.is_some() { options.tzid.clone().unwrap() } else { UTC }; - let mut partial_options = PartialOptions::concat(&default_partial_options, options); + let mut partial_options = Options::concat(&default_partial_options, options); if partial_options.byeaster.is_some() { partial_options.freq = Some(Frequenzy::Yearly); |