summaryrefslogtreecommitdiff
path: root/src/rrulestr.rs
diff options
context:
space:
mode:
authorFredrik Meringdal <fmeringdal@hotmail.com>2020-11-01 21:22:20 +0100
committerFredrik Meringdal <fmeringdal@hotmail.com>2020-11-01 21:22:20 +0100
commited603b788b23535b086f2a7491627e018e8dce5d (patch)
tree15bda7fde8339ff6b105305f8f1a74c937430b44 /src/rrulestr.rs
parentf923e14ebe037c63f081ea036a9a259c5abd0935 (diff)
downloadrust_rrule-ed603b788b23535b086f2a7491627e018e8dce5d.zip
docs and removed some stuff from options
Diffstat (limited to 'src/rrulestr.rs')
-rw-r--r--src/rrulestr.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/rrulestr.rs b/src/rrulestr.rs
index 20670f8..62a2e29 100644
--- a/src/rrulestr.rs
+++ b/src/rrulestr.rs
@@ -9,23 +9,20 @@ use once_cell::sync::Lazy;
use regex::Regex;
use std::str::FromStr;
+/// Some regex used for parsing the rrule string.
static DATESTR_RE: Lazy<Regex> =
Lazy::new(|| Regex::new(r"(?m)^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$").unwrap());
static DTSTART_RE: Lazy<Regex> =
Lazy::new(|| Regex::new(r"(?m)DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)").unwrap());
-
static RRULE_RE: Lazy<Regex> = Lazy::new(|| Regex::new(r"(?m)^(?:RRULE|EXRULE):").unwrap());
-
static PARSE_LINE_RE_1: Lazy<Regex> = Lazy::new(|| Regex::new(r"(?m)^\s+|\s+$").unwrap());
static PARSE_LINE_RE_2: Lazy<Regex> = Lazy::new(|| Regex::new(r"(?m)^([A-Z]+?)[:;]").unwrap());
-
static RDATE_RE: Lazy<Regex> = Lazy::new(|| Regex::new(r"(?m)RDATE(?:;TZID=([^:=]+))?").unwrap());
static EXDATE_RE: Lazy<Regex> = Lazy::new(|| Regex::new(r"(?m)EXDATE(?:;TZID=([^:=]+))?").unwrap());
-
-
static DATETIME_RE: Lazy<Regex> =
Lazy::new(|| Regex::new(r"(?m)(VALUE=DATE(-TIME)?)|(TZID=)").unwrap());
+
fn parse_datestring_bit<T: FromStr>(
bits: &regex::Captures,
i: usize,
@@ -171,7 +168,7 @@ fn parse_rrule(line: &str) -> Result<Options, RRuleParseError> {
options.interval = Some(interval);
}
"BYSETPOS" => {
- let bysetpos = stringval_to_intvec(value, |pos| true, format!("Invalid bysetpos value"))?;
+ let bysetpos = stringval_to_intvec(value, |_pos| true, format!("Invalid bysetpos value"))?;
options.bysetpos = Some(bysetpos);
}
"BYMONTH" => {