Use a where clause for rect_contains_point to bring the line under 100 columns.

This commit is contained in:
Ms2ger 2015-10-23 10:35:11 +02:00
parent dcd207f9bf
commit d20ef3b6d8

View file

@ -89,7 +89,9 @@ pub static MAX_RECT: Rect<Au> = Rect {
/// Returns true if the rect contains the given point. Points on the top or left sides of the rect
/// are considered inside the rectangle, while points on the right or bottom sides of the rect are
/// not considered inside the rectangle.
pub fn rect_contains_point<T: PartialOrd + Add<T, Output=T>>(rect: Rect<T>, point: Point2D<T>) -> bool {
pub fn rect_contains_point<T>(rect: Rect<T>, point: Point2D<T>) -> bool
where T: PartialOrd + Add<T, Output=T>
{
point.x >= rect.origin.x && point.x < rect.origin.x + rect.size.width &&
point.y >= rect.origin.y && point.y < rect.origin.y + rect.size.height
}