cleanup and stats accounting organization

This commit is contained in:
John Smith
2021-11-26 09:54:38 -05:00
parent 311dc908fe
commit a80178da54
9 changed files with 341 additions and 231 deletions

View File

@@ -99,3 +99,24 @@ where
}
None
}
pub trait CmpAssign {
fn min_assign(&mut self, other: Self);
fn max_assign(&mut self, other: Self);
}
impl<T> CmpAssign for T
where
T: core::cmp::Ord,
{
fn min_assign(&mut self, other: Self) {
if &other < self {
*self = other;
}
}
fn max_assign(&mut self, other: Self) {
if &other > self {
*self = other;
}
}
}