The convex_hull fn param -> points_slice: &[Point<T>] is a set of points, there is no specific limit (like x = {0,width} and y = {0,height} when the param is an image).
Since in the original implementation I was converting it to usize it was failing when the generic type T included negative values.
Actually, that conversion can be avoided by including Ordand Bounded traits to the generic type definition.
The
convex_hull
fn param ->points_slice: &[Point<T>]
is a set of points, there is no specific limit (likex = {0,width}
andy = {0,height}
when the param is an image). Since in the original implementation I was converting it tousize
it was failing when the generic type T included negative values. Actually, that conversion can be avoided by includingOrd
andtraitBounded
sto the generic type definition.