diff --git a/src/lib.rs b/src/lib.rs index 2e3cd93..b2f926e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -247,6 +247,10 @@ impl CondUnit { (CondUnit::Star, ONE_SECOND_NANOSECOND) } + fn contain(c: char) -> bool { + Self::expect_val().contains(&&*c.to_string()) + } + fn change_duration(&self) -> u64 { match self { CondUnit::Plus => 0, diff --git a/src/unit.rs b/src/unit.rs index 4546655..e74a77b 100644 --- a/src/unit.rs +++ b/src/unit.rs @@ -1,6 +1,6 @@ use crate::error::PError; use crate::{ - DError, DResult, ExpectErr, ONE_DAY_NANOSECOND, ONE_HOUR_NANOSECOND, + CondUnit, DError, DResult, ExpectErr, ONE_DAY_NANOSECOND, ONE_HOUR_NANOSECOND, ONE_MICROSECOND_NANOSECOND, ONE_MILLISECOND_NANOSECOND, ONE_MINUTE_NANOSECOND, ONE_MONTH_NANOSECOND, ONE_SECOND_NANOSECOND, ONE_WEEK_NANOSECOND, ONE_YEAR_NANOSECOND, }; @@ -112,7 +112,7 @@ pub(crate) fn opt_unit_abbr<'a>(input: &mut &'a str) -> PResult