stub implementation of Div and DivAssign for SmallInt and SmallUint

This commit is contained in:
Solomon Ucko 2022-08-09 20:43:15 -04:00
parent 51f1c7d38a
commit 1fe105f58c

View File

@ -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;
}
}