auto merge of #9459 : eliovir/rust/patch-1, r=bstrie

change formula (other solution could be using abs()).
This commit is contained in:
bors 2013-09-28 05:26:04 -07:00
commit 058a5d97a2
1 changed files with 1 additions and 1 deletions

View File

@ -737,7 +737,7 @@ fn area(sh: Shape) -> float {
match sh {
Circle { radius: radius, _ } => float::consts::pi * square(radius),
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)
}
}
}