Fixed with more trait bounds on Number

This commit is contained in:
Bill Thiede 2019-11-29 17:10:46 -08:00
parent 0ea2623bfa
commit 826ca704c4

View File

@ -6,7 +6,13 @@ type Float = f32;
pub trait Number pub trait Number
where where
Self: std::marker::Sized + Copy + fmt::Display + Mul + Sub, Self: std::marker::Sized
+ Copy
+ fmt::Display
+ Mul
+ Mul<Output = Self>
+ Sub
+ Sub<Output = Self>,
{ {
// Real version has stuff here // Real version has stuff here
} }
@ -83,11 +89,7 @@ where
T: Number, T: Number,
{ {
pub fn area(&self) -> T { pub fn area(&self) -> T {
// TODO(glenng) make this compile.
/*
let d = self.p_max - self.p_min; let d = self.p_max - self.p_min;
d.x * d.y d.x * d.y
*/
unimplemented!();
} }
} }