support negating Durations

This commit is contained in:
Scott Lamb 2021-04-22 10:04:14 -07:00
parent d99cab5f27
commit c53250c0c5

View File

@ -304,6 +304,13 @@ impl ops::Mul<i64> for Duration {
}
}
impl std::ops::Neg for Duration {
type Output = Self;
fn neg(self) -> Self::Output {
Duration(-self.0)
}
}
impl ops::Add for Duration {
type Output = Duration;
fn add(self, rhs: Duration) -> Duration {