diff options
author | Fredrik Meringdal <fmeringdal@hotmail.com> | 2020-11-03 23:22:51 +0100 |
---|---|---|
committer | Fredrik Meringdal <fmeringdal@hotmail.com> | 2020-11-03 23:22:51 +0100 |
commit | 00ba4141d5bb41f0ffc014c76bfdafcec7c02b6b (patch) | |
tree | 682f9f09ff13849a455d01ea7949a5c4a581663d /src/lib.rs | |
parent | 66317f2566897556488af09e9ca73a06b9439b0f (diff) | |
download | rust_rrule-00ba4141d5bb41f0ffc014c76bfdafcec7c02b6b.zip |
using lazy_static instead of once_cell
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -18,7 +18,8 @@ //! - `between`: Generate all recurrences that matches the rules and are between two given dates //! - `before`: Generate the last recurrence that matches the rules and is before a given date //! - `after`: Generate the first recurrence that matches the rules and is after a given date -//! All the generated recurrence will be in the same time zone as the dtstart property. +//! +//! Note: All the generated recurrence will be in the same time zone as the dtstart property. //! //! # Examples //! @@ -29,14 +30,14 @@ //! //! use rrule::RRule; //! -//! // Parse a RRule string, return a RRul to get e type +//! // Parse a RRule string //! let mut rrule: RRule = "DTSTART:20120201T093000Z\nRRULE:FREQ=WEEKLY;INTERVAL=5;UNTIL=20130130T230000Z;BYDAY=MO,FR".parse().unwrap(); //! assert_eq!(rrule.all().len(), 21); //! //! //! use rrule::RRuleSet; //! -//! // Parse a RRuleSet string, return a RRuleSet type +//! // Parse a RRuleSet string //! let mut rrule_set: RRuleSet = "DTSTART:20120201T023000Z\nRRULE:FREQ=MONTHLY;COUNT=5\nRDATE:20120701T023000Z,20120702T023000Z\nEXRULE:FREQ=MONTHLY;COUNT=2\nEXDATE:20120601T023000Z".parse().unwrap(); //! assert_eq!(rrule_set.all().len(), 4); //! ``` @@ -120,7 +121,7 @@ //! rrule_set.exrule(exrule); //! //! let recurrences = rrule_set.all(); -//! +//! //! // Check that all the recurrences are on a Tuesday //! for occurence in &recurrences { //! assert_eq!(occurence.weekday(), Weekday::Tue); @@ -191,8 +192,9 @@ extern crate chrono; extern crate chrono_tz; -extern crate once_cell; extern crate regex; +#[macro_use] +extern crate lazy_static; mod datetime; mod iter; |