diff options
author | Fredrik Meringdal <fredrikmeringdal@Fredriks-MacBook-Pro.local> | 2021-02-03 17:55:43 +0100 |
---|---|---|
committer | Fredrik Meringdal <fredrikmeringdal@Fredriks-MacBook-Pro.local> | 2021-02-03 17:55:43 +0100 |
commit | 61aac0d2773f7a073b63661ec150954414f5696e (patch) | |
tree | 739b82650bafd04cdd29ca7aa4f2af94c6afb1b8 /src/iter/iterinfo.rs | |
parent | 4b12b6328955612dcb4a248a14d64864d9aecdf1 (diff) | |
download | rust_rrule-61aac0d2773f7a073b63661ec150954414f5696e.zip |
iterator for rrule
Diffstat (limited to 'src/iter/iterinfo.rs')
-rw-r--r-- | src/iter/iterinfo.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/iter/iterinfo.rs b/src/iter/iterinfo.rs index 7c47645..048632b 100644 --- a/src/iter/iterinfo.rs +++ b/src/iter/iterinfo.rs @@ -5,15 +5,15 @@ use crate::iter::yearinfo::{rebuild_year, YearInfo}; use crate::options::{Frequenzy, ParsedOptions}; use chrono::prelude::*; -pub struct IterInfo<'a> { +pub struct IterInfo { pub yearinfo: Option<YearInfo>, pub monthinfo: Option<MonthInfo>, pub eastermask: Option<Vec<isize>>, - options: &'a ParsedOptions, + pub options: ParsedOptions, } -impl<'a> IterInfo<'a> { - pub fn new(options: &'a ParsedOptions) -> Self { +impl IterInfo { + pub fn new(options: ParsedOptions) -> Self { Self { options, yearinfo: None, @@ -24,7 +24,7 @@ impl<'a> IterInfo<'a> { pub fn rebuild(&mut self, year: isize, month: usize) { if self.monthinfo.is_none() || year != self.monthinfo.as_ref().unwrap().lastyear { - self.yearinfo = Some(rebuild_year(year as i32, self.options)); + self.yearinfo = Some(rebuild_year(year as i32, &self.options)); } if !self.options.bynweekday.is_empty() @@ -38,7 +38,7 @@ impl<'a> IterInfo<'a> { yearinfo.yearlen, &yearinfo.mrange, &yearinfo.wdaymask, - self.options, + &self.options, )); } } |