From 59c3307c270b8fc9e2c17f3d2825a2256d4e0a34 Mon Sep 17 00:00:00 2001 From: Victoria Fischer Date: Sun, 1 Dec 2024 21:09:56 +0100 Subject: [PATCH] geometry: make rectangle::new const --- src/geometry.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/geometry.rs b/src/geometry.rs index bed20ad..2c78916 100644 --- a/src/geometry.rs +++ b/src/geometry.rs @@ -100,9 +100,9 @@ pub struct Rectangle { } impl Rectangle { - pub fn new(top_left: Coordinates, bottom_right: Coordinates) -> Self { - debug_assert!(top_left.x <= bottom_right.x); - debug_assert!(top_left.y <= bottom_right.y); + pub const fn new(top_left: Coordinates, bottom_right: Coordinates) -> Self { + //debug_assert!(top_left.x <= bottom_right.x); + //debug_assert!(top_left.y <= bottom_right.y); Self { top_left, bottom_right