diff options
author | Fredrik Meringdal <fmeringdal@hotmail.com> | 2021-05-12 17:13:26 +0200 |
---|---|---|
committer | Fredrik Meringdal <fmeringdal@hotmail.com> | 2021-05-12 17:13:26 +0200 |
commit | a2c30c2a5f377fb5f5b7c912a66f950950c760f2 (patch) | |
tree | a2f56e14fee928b1b08ae6992f86a06026f49c4a /src/iter/mod.rs | |
parent | 7c8d64b028b3c7c1b55b55ad088ecbcb48d8bdc5 (diff) | |
download | rust_rrule-a2c30c2a5f377fb5f5b7c912a66f950950c760f2.zip |
masks
Diffstat (limited to 'src/iter/mod.rs')
-rw-r--r-- | src/iter/mod.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/iter/mod.rs b/src/iter/mod.rs index efec2ca..2d78bab 100644 --- a/src/iter/mod.rs +++ b/src/iter/mod.rs @@ -156,8 +156,13 @@ pub fn increment_counter_date( } pub fn is_filtered(ii: &IterInfo, current_day: usize, options: &ParsedOptions) -> bool { - return (not_empty(&options.bymonth) - && !includes(&options.bymonth, &ii.mmask().unwrap()[current_day])) + if !options.bymonth.is_empty() { + println!("Current day: {}", current_day); + println!("Byymonth: {:?}", options.bymonth); + println!("mask: {:?}", ii.mmask().unwrap()); + } + return (!options.bymonth.is_empty() + && !options.bymonth.contains(&ii.mmask().unwrap()[current_day])) || (not_empty(&options.byweekno) && (ii.wnomask().unwrap()[current_day]) == 0) || (not_empty(&options.byweekday) && !includes(&options.byweekday, &ii.wdaymask().unwrap()[current_day])) @@ -217,7 +222,8 @@ pub fn build_timeset(options: &ParsedOptions) -> Vec<Time> { return vec![]; } - let mut timeset = vec![]; + let mut timeset = + Vec::with_capacity(options.byhour.len() * options.byminute.len() * options.bysecond.len()); for hour in &options.byhour { for minute in &options.byminute { for second in &options.bysecond { |