diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2017-09-26 18:23:28 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2017-09-26 18:23:28 +0200 |
commit | fae0a2b502a04b2749f12f7ddb04d72ee86e60dd (patch) | |
tree | ca3ff61f3c564702827ed57d446fdd56db8967c5 /src/indicator.rs | |
parent | ba211d419e78cd9148803868096d98a1de38cce3 (diff) |
Fix feature-gate-caused compiler errors
Diffstat (limited to 'src/indicator.rs')
-rw-r--r-- | src/indicator.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/indicator.rs b/src/indicator.rs index 72e1136..fa9bf63 100644 --- a/src/indicator.rs +++ b/src/indicator.rs @@ -1,3 +1,15 @@ +#[cfg(feature = "with-filters")] +use filters::filter::Filter; + +#[cfg(feature = "with-filters")] +use filters::filter::IntoFilter; + +#[cfg(feature = "with-filters")] +use timetype::TimeType; + +#[cfg(feature = "with-filters")] +use chrono::Datelike; + #[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Debug)] pub enum Day { Monday, @@ -64,7 +76,7 @@ pub struct DayFilter(Day); #[cfg(feature = "with-filters")] impl Filter<TimeType> for DayFilter { fn filter(&self, tt: &TimeType) -> bool { - tt.get_moment(|mom| mom.weekday() == self.0.into()).unwrap_or(false) + tt.get_moment().map(|mom| mom.weekday() == self.0.clone().into()).unwrap_or(false) } } @@ -85,7 +97,7 @@ pub struct MonthFilter(Month); #[cfg(feature = "with-filters")] impl Filter<TimeType> for MonthFilter { fn filter(&self, tt: &TimeType) -> bool { - tt.get_moment(|mom| mom.month() == self.0.into()).unwrap_or(false) + tt.get_moment().map(|mom| mom.month() == self.0.clone().into()).unwrap_or(false) } } |