From 4d968da1adc960e4ac51d0f3c39ea0d9ef77e1c1 Mon Sep 17 00:00:00 2001 From: Solra Bizna Date: Wed, 25 May 2022 16:42:18 -0600 Subject: [PATCH] Make "Point::new" a const fn --- src/geometry/point_construction.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/geometry/point_construction.rs b/src/geometry/point_construction.rs index 2136080a..ac54b349 100644 --- a/src/geometry/point_construction.rs +++ b/src/geometry/point_construction.rs @@ -202,7 +202,7 @@ impl Point1 { /// assert_eq!(p.x, 1.0); /// ``` #[inline] - pub fn new(x: T) -> Self { + pub const fn new(x: T) -> Self { Point { coords: Vector1::new(x), } @@ -216,7 +216,7 @@ macro_rules! componentwise_constructors_impl( #[doc = $doc] #[doc = "```"] #[inline] - pub fn new($($args: T),*) -> Self { + pub const fn new($($args: T),*) -> Self { Point { coords: $Vector::new($($args),*) } } }