diff options
author | Fredrik Meringdal <fredrikmeringdal@Fredriks-MacBook-Pro.local> | 2021-02-03 22:42:33 +0100 |
---|---|---|
committer | Fredrik Meringdal <fredrikmeringdal@Fredriks-MacBook-Pro.local> | 2021-02-03 22:42:33 +0100 |
commit | bc16f6e7e6bbd145d1d0f541f98d74061f7fa966 (patch) | |
tree | dd0046e58432903c9c62a198d99f0f6d98b90d92 /src/parse_options.rs | |
parent | 953e16879ef2e1d0898c62bb26e2ed023aea30f3 (diff) | |
download | rust_rrule-bc16f6e7e6bbd145d1d0f541f98d74061f7fa966.zip |
docs
Diffstat (limited to 'src/parse_options.rs')
-rw-r--r-- | src/parse_options.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/parse_options.rs b/src/parse_options.rs index 7953887..f6af1d9 100644 --- a/src/parse_options.rs +++ b/src/parse_options.rs @@ -1,4 +1,6 @@ -use crate::options::{Frequenzy, NWeekday, NWeekdayIdentifier, Options, ParsedOptions, RRuleParseError}; +use crate::options::{ + Frequenzy, NWeekday, NWeekdayIdentifier, Options, ParsedOptions, RRuleParseError, +}; use crate::utils::is_some_and_not_empty; use chrono::prelude::*; use chrono_tz::{Tz, UTC}; @@ -69,8 +71,10 @@ pub fn parse_options(options: &Options) -> Result<ParsedOptions, RRuleParseError partial_options.bymonthday = Some(vec![dtstart.day() as isize]); } Frequenzy::Weekly => { - partial_options.byweekday = - Some(vec![NWeekday::new(dtstart.weekday() as usize, NWeekdayIdentifier::Every)]); + partial_options.byweekday = Some(vec![NWeekday::new( + dtstart.weekday() as usize, + NWeekdayIdentifier::Every, + )]); } _ => (), }; @@ -100,9 +104,7 @@ pub fn parse_options(options: &Options) -> Result<ParsedOptions, RRuleParseError if let Some(opts_byweekday) = partial_options.byweekday { for wday in opts_byweekday { match wday.n { - NWeekdayIdentifier::Every => { - byweekday.push(wday.weekday) - } + NWeekdayIdentifier::Every => byweekday.push(wday.weekday), NWeekdayIdentifier::Identifier(n) => { bynweekday.push(vec![wday.weekday as isize, n]); } |