Fixed with more trait bounds on Number
This commit is contained in:
parent
0ea2623bfa
commit
826ca704c4
12
src/lib.rs
12
src/lib.rs
@ -6,7 +6,13 @@ type Float = f32;
|
||||
|
||||
pub trait Number
|
||||
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
|
||||
}
|
||||
@ -83,11 +89,7 @@ where
|
||||
T: Number,
|
||||
{
|
||||
pub fn area(&self) -> T {
|
||||
// TODO(glenng) make this compile.
|
||||
/*
|
||||
let d = self.p_max - self.p_min;
|
||||
d.x * d.y
|
||||
*/
|
||||
unimplemented!();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user