mirror of
https://gitlab.com/artofrev/smallint.git
synced 2024-12-04 17:11:38 -05:00
stub implementation of Div and DivAssign for SmallInt and SmallUint
This commit is contained in:
parent
51f1c7d38a
commit
1fe105f58c
40
src/ops.rs
40
src/ops.rs
|
@ -1,8 +1,8 @@
|
|||
use crate::smallint::{SmallIntType, SmallUintType};
|
||||
use crate::{SmallInt, SmallUint};
|
||||
use core::mem::ManuallyDrop;
|
||||
use core::ops::{Add, Mul, Neg, Sub};
|
||||
use core::ops::{AddAssign, MulAssign, SubAssign};
|
||||
use core::ops::{Add, Div, Mul, Neg, Sub};
|
||||
use core::ops::{AddAssign, DivAssign, MulAssign, SubAssign};
|
||||
|
||||
impl Neg for SmallInt {
|
||||
type Output = Self;
|
||||
|
@ -581,3 +581,39 @@ impl MulAssign<SmallInt> for SmallInt {
|
|||
*self = self.clone() * rhs;
|
||||
}
|
||||
}
|
||||
|
||||
fn div(a: &SmallUint, b: &SmallUint) -> SmallUint {
|
||||
todo!()
|
||||
}
|
||||
|
||||
basic_op!(Div, div, SmallUint, div);
|
||||
|
||||
impl<'a> DivAssign<&'a SmallUint> for SmallUint {
|
||||
fn div_assign(&mut self, rhs: &'a SmallUint) {
|
||||
*self = self.clone() / rhs;
|
||||
}
|
||||
}
|
||||
|
||||
impl DivAssign<SmallUint> for SmallUint {
|
||||
fn div_assign(&mut self, rhs: SmallUint) {
|
||||
*self = self.clone() / rhs;
|
||||
}
|
||||
}
|
||||
|
||||
fn div_signed(a: &SmallInt, b: &SmallInt) -> SmallInt {
|
||||
todo!()
|
||||
}
|
||||
|
||||
basic_op!(Div, div, SmallInt, div_signed);
|
||||
|
||||
impl<'a> DivAssign<&'a SmallInt> for SmallInt {
|
||||
fn div_assign(&mut self, rhs: &'a SmallInt) {
|
||||
*self = self.clone() / rhs;
|
||||
}
|
||||
}
|
||||
|
||||
impl DivAssign<SmallInt> for SmallInt {
|
||||
fn div_assign(&mut self, rhs: SmallInt) {
|
||||
*self = self.clone() / rhs;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user