auto merge of #9459 : eliovir/rust/patch-1, r=bstrie
change formula (other solution could be using abs()).
This commit is contained in:
commit
058a5d97a2
|
@ -737,7 +737,7 @@ fn area(sh: Shape) -> float {
|
||||||
match sh {
|
match sh {
|
||||||
Circle { radius: radius, _ } => float::consts::pi * square(radius),
|
Circle { radius: radius, _ } => float::consts::pi * square(radius),
|
||||||
Rectangle { top_left: top_left, bottom_right: bottom_right } => {
|
Rectangle { top_left: top_left, bottom_right: bottom_right } => {
|
||||||
(bottom_right.x - top_left.x) * (bottom_right.y - top_left.y)
|
(bottom_right.x - top_left.x) * (top_left.y - bottom_right.y)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue