Apply suggestions from code review
Co-authored-by: Lokathor <zefria@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#![feature(repr_simd)]
|
#![feature(repr_simd)]
|
||||||
|
#![warn(missing_docs)]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
mod macros;
|
mod macros;
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ macro_rules! define_type {
|
|||||||
|
|
||||||
// splat
|
// splat
|
||||||
impl From<$type> for $name {
|
impl From<$type> for $name {
|
||||||
|
#[inline]
|
||||||
fn from(value: $type) -> Self {
|
fn from(value: $type) -> Self {
|
||||||
Self::splat(value)
|
Self::splat(value)
|
||||||
}
|
}
|
||||||
@@ -126,16 +127,16 @@ macro_rules! define_type {
|
|||||||
pub struct $name($($itype),*);
|
pub struct $name($($itype),*);
|
||||||
|
|
||||||
impl $name {
|
impl $name {
|
||||||
/// Construct a vector by setting each lane to a single value.
|
/// Construct a vector by setting all lanes to the given value.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn splat(value: $type) -> Self {
|
pub const fn splat(value: $type) -> Self {
|
||||||
Self($(value as $itype),*)
|
Self($(value as $itype),*)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Construct a vector by setting each lane.
|
/// Construct a vector by setting each lane to the given values.
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new($($ivar: $itype),*) -> Self {
|
pub const fn new($($ivar: $itype),*) -> Self {
|
||||||
Self($($ivar),*)
|
Self($($ivar),*)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user