mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
Offset -> Plus; add Minus
This commit is contained in:
parent
dc03a664a4
commit
00da7de142
5 changed files with 176 additions and 77 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue