Lines Matching refs:rhs

483     pub fn checked_add_signed(self, rhs: OldDuration) -> Option<NaiveDateTime> {  in checked_add_signed()
484 let (time, rhs) = self.time.overflowing_add_signed(rhs); in checked_add_signed()
487 if rhs <= (-1 << MAX_SECS_BITS) || rhs >= (1 << MAX_SECS_BITS) { in checked_add_signed()
491 let date = try_opt!(self.date.checked_add_signed(OldDuration::seconds(rhs))); in checked_add_signed()
565 pub fn checked_sub_signed(self, rhs: OldDuration) -> Option<NaiveDateTime> { in checked_sub_signed()
566 let (time, rhs) = self.time.overflowing_sub_signed(rhs); in checked_sub_signed()
569 if rhs <= (-1 << MAX_SECS_BITS) || rhs >= (1 << MAX_SECS_BITS) { in checked_sub_signed()
573 let date = try_opt!(self.date.checked_sub_signed(OldDuration::seconds(rhs))); in checked_sub_signed()
621 pub fn signed_duration_since(self, rhs: NaiveDateTime) -> OldDuration { in signed_duration_since()
622 self.date.signed_duration_since(rhs.date) + self.time.signed_duration_since(rhs.time) in signed_duration_since()
1255 fn add(self, rhs: OldDuration) -> NaiveDateTime { in add()
1256 self.checked_add_signed(rhs).expect("`NaiveDateTime + Duration` overflowed") in add()
1262 fn add_assign(&mut self, rhs: OldDuration) { in add_assign()
1263 *self = self.add(rhs); in add_assign()
1325 fn sub(self, rhs: OldDuration) -> NaiveDateTime { in sub()
1326 self.checked_sub_signed(rhs).expect("`NaiveDateTime - Duration` overflowed") in sub()
1332 fn sub_assign(&mut self, rhs: OldDuration) { in sub_assign()
1333 *self = self.sub(rhs); in sub_assign()
1387 fn sub(self, rhs: NaiveDateTime) -> OldDuration { in sub()
1388 self.signed_duration_since(rhs) in sub()
2206 fn check((y,m,d,h,n,s): (i32,u32,u32,u32,u32,u32), rhs: Duration, in test_datetime_add()
2210 assert_eq!(lhs.checked_add_signed(rhs), sum); in test_datetime_add()
2211 assert_eq!(lhs.checked_sub_signed(-rhs), sum); in test_datetime_add()