From 9a20f1031cbc3ff959cdd7ca4c86964b578d1b8d Mon Sep 17 00:00:00 2001 From: Nathan Stoddard Date: Sat, 12 Jan 2019 14:50:34 -0800 Subject: [PATCH] Declare vector constructors to be const This makes it easier to create vectors in constants. --- src/vector.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vector.rs b/src/vector.rs index 9acc7b3..72366c6 100644 --- a/src/vector.rs +++ b/src/vector.rs @@ -99,7 +99,7 @@ macro_rules! impl_vector { impl $VectorN { /// Construct a new vector, using the provided values. #[inline] - pub fn new($($field: S),+) -> $VectorN { + pub const fn new($($field: S),+) -> $VectorN { $VectorN { $($field: $field),+ } } @@ -115,7 +115,7 @@ macro_rules! impl_vector { /// The short constructor. #[inline] - pub fn $constructor($($field: S),+) -> $VectorN { + pub const fn $constructor($($field: S),+) -> $VectorN { $VectorN::new($($field),+) }