geometry: make rectangle::new const
This commit is contained in:
parent
28c9d61926
commit
59c3307c27
@ -100,9 +100,9 @@ pub struct Rectangle<Space: CoordinateSpace> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<Space: CoordinateSpace> Rectangle<Space> {
|
impl<Space: CoordinateSpace> Rectangle<Space> {
|
||||||
pub fn new(top_left: Coordinates<Space>, bottom_right: Coordinates<Space>) -> Self {
|
pub const fn new(top_left: Coordinates<Space>, bottom_right: Coordinates<Space>) -> Self {
|
||||||
debug_assert!(top_left.x <= bottom_right.x);
|
//debug_assert!(top_left.x <= bottom_right.x);
|
||||||
debug_assert!(top_left.y <= bottom_right.y);
|
//debug_assert!(top_left.y <= bottom_right.y);
|
||||||
Self {
|
Self {
|
||||||
top_left,
|
top_left,
|
||||||
bottom_right
|
bottom_right
|
||||||
|
Loading…
x
Reference in New Issue
Block a user