mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-04 18:08:26 +00:00
Make conversion into vector generic
This commit is contained in:
parent
24ab6c42a2
commit
b8c729e077
@ -9,11 +9,11 @@ pub struct Vector<const D: usize> {
|
||||
pub components: [Scalar; D],
|
||||
}
|
||||
|
||||
impl<S> From<[S; 3]> for Vector<3>
|
||||
impl<S, const D: usize> From<[S; D]> for Vector<D>
|
||||
where
|
||||
S: Into<Scalar>,
|
||||
{
|
||||
fn from(components: [S; 3]) -> Self {
|
||||
fn from(components: [S; D]) -> Self {
|
||||
Self {
|
||||
components: components.map(Into::into),
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user