Offset -> Plus; add Minus

This commit is contained in:
🪞👃🪞 2024-09-13 02:04:19 +03:00
parent dc03a664a4
commit 00da7de142
5 changed files with 176 additions and 77 deletions

View file

@ -62,7 +62,16 @@ pub trait Number: Send + Sync + Copy
+ Div<Self, Output=Self>
+ Ord + PartialEq + Eq
+ Debug + Display + Default
+ From<u16> {}
+ From<u16>
{
fn minus (self, other: Self) -> Self {
if self >= other {
self - other
} else {
0.into()
}
}
}
impl<T> Number for T where
T: Send + Sync + Copy