Skip to content

Commit

Permalink
Merge pull request #1112 from SolraBizna/point-construction-const-fn
Browse files Browse the repository at this point in the history
Make "Point::new" a const fn
  • Loading branch information
sebcrozet authored Aug 14, 2022
2 parents daa2ea3 + 4d968da commit 0fcf2f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/geometry/point_construction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand All @@ -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),*) }
}
}
Expand Down

0 comments on commit 0fcf2f6

Please sign in to comment.