pub fn intersect(&self, other: &DateRange) -> Option<DateRange> {
        if other.from >= self.to || other.to <= self.from {
            None
        } else {
            let from = cmp::max(self.from, other.from);
            let to = cmp::min(self.to, other.to);
            Some(DateRange::new(from, to))
        }
    }
// region: utility
/// Returns a `DateRange` that represents the intersection
/// of the two input `DateRange`. Is an Option to allow for
/// the the two ranges not overlapping, in which case None is returned
utility
Returns a `DateRange` that represents the intersection
of the two input `DateRange`. Is an Option to allow for
the the two ranges not overlapping, in which case None is returned
utility Returns a ` DateRange ` that represents the intersection of the two input ` DateRange ` . Is an Option to allow for the the two ranges not overlapping in which case None is returned
pub fn intersect(&self, other: &DateRange) -> Option<DateRange> {
        if other.from >= self.to || other.to <= self.from {
            None
        } else {
            let from = cmp::max(self.from, other.from);
            let to = cmp::min(self.to, other.to);
            Some(DateRange::new(from, to))
        }
    }
pub fn intersect ( & self , other : & DateRange ) -> Option < DateRange > { if other . from >= self . to || other . to <= self . from { None } else { let from = cmp :: max ( self . from , other . from ) ; let to = cmp :: min ( self . to , other . to ) ; Some ( DateRange :: new ( from , to ) ) } }
region: utility
Returns a `DateRange` that represents the intersection
of the two input `DateRange`.
region : utility Returns a ` DateRange ` that represents the intersection of the two input ` DateRange ` .
&self
other
&DateRange
&self
other
&DateRange