Declare vector constructors to be const
This makes it easier to create vectors in constants.
This commit is contained in:
parent
5e758d13bd
commit
9a20f1031c
1 changed files with 2 additions and 2 deletions
|
@ -99,7 +99,7 @@ macro_rules! impl_vector {
|
|||
impl<S> $VectorN<S> {
|
||||
/// Construct a new vector, using the provided values.
|
||||
#[inline]
|
||||
pub fn new($($field: S),+) -> $VectorN<S> {
|
||||
pub const fn new($($field: S),+) -> $VectorN<S> {
|
||||
$VectorN { $($field: $field),+ }
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ macro_rules! impl_vector {
|
|||
|
||||
/// The short constructor.
|
||||
#[inline]
|
||||
pub fn $constructor<S>($($field: S),+) -> $VectorN<S> {
|
||||
pub const fn $constructor<S>($($field: S),+) -> $VectorN<S> {
|
||||
$VectorN::new($($field),+)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue