pub fn checked_add(self, rhs: Duration) -> Option<NaiveDate> {
        let year = self.year();
        let (mut year_div_400, year_mod_400) = div_mod_floor(year, 400);
        let cycle = internals::yo_to_cycle(year_mod_400 as u32, self.of().ordinal());
        let cycle = try_opt!((cycle as i32).checked_add(try_opt!(rhs.num_days().to_i32())));
        let (cycle_div_400y, cycle) = div_mod_floor(cycle, 146097);
        year_div_400 += cycle_div_400y;

        let (year_mod_400, ordinal) = internals::cycle_to_yo(cycle as u32);
        let flags = YearFlags::from_year_mod_400(year_mod_400 as i32);
        NaiveDate::from_of(year_div_400 * 400 + year_mod_400 as i32,
                           Of::new(ordinal, flags))
    }
/// Adds the `days` part of given `Duration` to the current date.
///
/// Returns `None` when it will result in overflow.
Adds the `days` part of given `Duration` to the current date.
Returns `None` when it will result in overflow.
Adds the ` days ` part of given ` Duration ` to the current date . Returns ` None ` when it will result in overflow .
pub fn checked_add(self, rhs: Duration) -> Option<NaiveDate> {
        let year = self.year();
        let (mut year_div_400, year_mod_400) = div_mod_floor(year, 400);
        let cycle = internals::yo_to_cycle(year_mod_400 as u32, self.of().ordinal());
        let cycle = try_opt!((cycle as i32).checked_add(try_opt!(rhs.num_days().to_i32())));
        let (cycle_div_400y, cycle) = div_mod_floor(cycle, 146097);
        year_div_400 += cycle_div_400y;
        let (year_mod_400, ordinal) = internals::cycle_to_yo(cycle as u32);
        let flags = YearFlags::from_year_mod_400(year_mod_400 as i32);
        NaiveDate::from_of(year_div_400 * 400 + year_mod_400 as i32,
                           Of::new(ordinal, flags))
    }
pub fn checked_add ( self , rhs : Duration ) -> Option < NaiveDate > { let year = self . year ( ) ; let ( mut year_div_400 , year_mod_400 ) = div_mod_floor ( year , 400 ) ; let cycle = internals :: yo_to_cycle ( year_mod_400 as u32 , self . of ( ) . ordinal ( ) ) ; let cycle = try_opt ! ( ( cycle as i32 ) checked_add ( try_opt ( rhs num_days ( ) to_i32 ( ) ) ) ) ; let ( cycle_div_400y , cycle ) = div_mod_floor ( cycle , 146097 ) ; year_div_400 += cycle_div_400y ; let ( year_mod_400 , ordinal ) = internals :: cycle_to_yo ( cycle as u32 ) ; let flags = YearFlags :: from_year_mod_400 ( year_mod_400 as i32 ) ; NaiveDate :: from_of ( year_div_400 * 400 + year_mod_400 as i32 , Of :: new ( ordinal , flags ) ) }
Adds the `days` part of given `Duration` to the current date.
Adds the ` days ` part of given ` Duration ` to the current date .
self
rhs
Duration
self
rhs
Duration