Implement IntoMint trait for Vectors, Points, Matrices, and Quaternions
- Updated mint to 0.5.8, so that the IntoMint trait is available - Implemented IntoMint for Vectors, Points, Matrices, and Quaternions
This commit is contained in:
parent
af127633cc
commit
d4d19b9122
4 changed files with 14 additions and 2 deletions
|
@ -22,7 +22,7 @@ swizzle = []
|
|||
|
||||
[dependencies]
|
||||
approx = "0.5"
|
||||
mint = { version = "0.5", optional = true }
|
||||
mint = { version = "0.5.8", optional = true }
|
||||
num-traits = "0.2"
|
||||
# small_rng used only for benchmarks
|
||||
rand = { version = "0.8", features = ["small_rng"], optional = true }
|
||||
|
|
|
@ -373,6 +373,10 @@ macro_rules! impl_mint_conversions {
|
|||
$ArrayN { $( $field: v.$field, )+ }
|
||||
}
|
||||
}
|
||||
|
||||
impl<S: Clone> mint::IntoMint for $ArrayN<S> {
|
||||
type MintType = mint::$Mint<S>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1558,7 +1558,10 @@ macro_rules! mint_conversions {
|
|||
$MatrixN { $($field: m.$field.into()),+ }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
impl<S: Clone> mint::IntoMint for $MatrixN<S> {
|
||||
type MintType = mint::$MintN<S>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -685,6 +685,11 @@ impl<S: Clone> From<Quaternion<S>> for mint::Quaternion<S> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "mint")]
|
||||
impl <S: Clone> mint::IntoMint for Quaternion<S> {
|
||||
type MintType = mint::Quaternion<S>;
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use quaternion::*;
|
||||
|
|
Loading…
Reference in a new issue