From 91ca4b143db20394a07906b58e5c292cf4ead3f1 Mon Sep 17 00:00:00 2001 From: Tayfun Yasar Date: Sat, 23 Nov 2024 01:40:59 +0300 Subject: [PATCH] add error message (#694) --- src/contours.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/contours.rs b/src/contours.rs index dcdafb3b..0a74294d 100644 --- a/src/contours.rs +++ b/src/contours.rs @@ -147,8 +147,10 @@ where let mut pos3 = curr; loop { - contour_points - .push(Point::new(cast(pos3.x).unwrap(), cast(pos3.y).unwrap())); + contour_points.push(Point::new( + cast(pos3.x).expect("Generic Type Parameter T should be bigger than width."), + cast(pos3.y).expect("Generic Type Parameter T should be bigger than height."), + )); rotate_to_value(&mut diffs, pos2.to_i32() - pos3.to_i32()); let pos4 = diffs .iter()