…lines 1–69 unchanged (69 lines)
70
71impl std::ops::Add<Duration> for Instant {
72 type Output = Instant;
73
74 fn add(self, rhs: Duration) -> Self::Output {
75 self.checked_add_duration(&rhs)
76 .expect("duration addition overflow")
77 }
78}
79
80impl std::ops::Sub<Duration> for Instant {
81 type Output = Instant;
82
83 fn sub(self, rhs: Duration) -> Self::Output {
84 self.checked_sub_duration(&rhs)
85 .expect("duration subtraction underflow")
86 }
87}
88
89pub trait Clock {
90 fn now(&self) -> Instant;
91}
…lines 92–104 unchanged (13 lines)