Make "Point::new" a const fn

This commit is contained in:
Solra Bizna 2022-05-25 16:42:18 -06:00
parent b656faa233
commit 4d968da1ad
No known key found for this signature in database
GPG Key ID: 9A977F5CBE4AEAF5
1 changed files with 2 additions and 2 deletions

View File

@ -202,7 +202,7 @@ impl<T: Scalar> Point1<T> {
/// 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),*) }
}
}