diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/iter.rs | 4 | ||||
-rw-r--r-- | src/options.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/iter.rs b/src/iter.rs index dd1066a..e556318 100644 --- a/src/iter.rs +++ b/src/iter.rs @@ -310,7 +310,7 @@ pub fn is_filtered(ii: &IterInfo, current_day: usize, options: &ParsedOptions) - && !includes(&options.bynmonthday, &ii.nmdaymask().unwrap()[current_day])) || (not_empty(&options.byyearday) && ((current_day < ii.yearlen().unwrap() - && !includes(&options.byyearday, &(current_day + 1)) + && !includes(&options.byyearday, &(current_day as isize + 1)) && !includes( &options.byyearday.iter().map(|v| *v as isize).collect(), &(-(ii.yearlen().unwrap() as isize) + current_day as isize), @@ -318,7 +318,7 @@ pub fn is_filtered(ii: &IterInfo, current_day: usize, options: &ParsedOptions) - || (current_day >= ii.yearlen().unwrap() && !includes( &options.byyearday, - &(current_day + 1 - ii.yearlen().unwrap()), + &((current_day + 1 - ii.yearlen().unwrap()) as isize), ) && !includes( &options.byyearday.iter().map(|v| *v as isize).collect(), diff --git a/src/options.rs b/src/options.rs index 30143c1..9d037db 100644 --- a/src/options.rs +++ b/src/options.rs @@ -38,7 +38,7 @@ pub struct ParsedOptions { pub bymonth: Vec<usize>, pub bymonthday: Vec<usize>, pub bynmonthday: Vec<isize>, - pub byyearday: Vec<usize>, + pub byyearday: Vec<isize>, pub byweekno: Vec<isize>, pub byweekday: Vec<usize>, pub byhour: Vec<usize>, @@ -114,7 +114,7 @@ impl ParsedOptions { self.bynmonthday = bynmonthday; self } - pub fn byyearday(mut self, byyearday: Vec<usize>) -> Self { + pub fn byyearday(mut self, byyearday: Vec<isize>) -> Self { self.byyearday = byyearday; self } |