Add SubAssign for Size

This commit is contained in:
Christian Duerr 2021-11-10 22:01:39 +01:00 committed by Victor Berger
parent 0ea8899dcf
commit d46be20d6e
1 changed files with 8 additions and 0 deletions

View File

@ -637,6 +637,14 @@ impl<N: AddAssign, Kind> AddAssign for Size<N, Kind> {
}
}
impl<N: SubAssign, Kind> SubAssign for Size<N, Kind> {
#[inline]
fn sub_assign(&mut self, rhs: Self) {
self.w -= rhs.w;
self.h -= rhs.h
}
}
impl<N: Clone, Kind> Clone for Size<N, Kind> {
#[inline]
fn clone(&self) -> Self {