cargo fmt
This commit is contained in:
parent
9a98b0cf24
commit
71379c0748
|
@ -30,10 +30,13 @@ use std::mem;
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "rkyv-serialize-no-std",
|
feature = "rkyv-serialize-no-std",
|
||||||
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
||||||
archive(as = "ArrayStorage<T::Archived, R, C>", bound(archive = "
|
archive(
|
||||||
|
as = "ArrayStorage<T::Archived, R, C>",
|
||||||
|
bound(archive = "
|
||||||
T: rkyv::Archive,
|
T: rkyv::Archive,
|
||||||
[[T; R]; C]: rkyv::Archive<Archived = [[T::Archived; R]; C]>
|
[[T; R]; C]: rkyv::Archive<Archived = [[T::Archived; R]; C]>
|
||||||
"))
|
")
|
||||||
|
)
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
|
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
|
||||||
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
||||||
|
|
|
@ -12,7 +12,7 @@ use std::mem;
|
||||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||||
|
|
||||||
#[cfg(feature = "rkyv-serialize-no-std")]
|
#[cfg(feature = "rkyv-serialize-no-std")]
|
||||||
use rkyv::{Archive, Archived, with::With};
|
use rkyv::{with::With, Archive, Archived};
|
||||||
#[cfg(feature = "rkyv-serialize-no-std")]
|
#[cfg(feature = "rkyv-serialize-no-std")]
|
||||||
use rkyv_wrappers::custom_phantom::CustomPhantom;
|
use rkyv_wrappers::custom_phantom::CustomPhantom;
|
||||||
|
|
||||||
|
@ -158,11 +158,14 @@ pub type MatrixCross<T, R1, C1, R2, C2> =
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "rkyv-serialize-no-std",
|
feature = "rkyv-serialize-no-std",
|
||||||
derive(Archive, rkyv::Serialize, rkyv::Deserialize),
|
derive(Archive, rkyv::Serialize, rkyv::Deserialize),
|
||||||
archive(as = "Matrix<T::Archived, R, C, S::Archived>", bound(archive = "
|
archive(
|
||||||
|
as = "Matrix<T::Archived, R, C, S::Archived>",
|
||||||
|
bound(archive = "
|
||||||
T: Archive,
|
T: Archive,
|
||||||
S: Archive,
|
S: Archive,
|
||||||
With<PhantomData<(T, R, C)>, CustomPhantom<(Archived<T>, R, C)>>: Archive<Archived = PhantomData<(Archived<T>, R, C)>>
|
With<PhantomData<(T, R, C)>, CustomPhantom<(Archived<T>, R, C)>>: Archive<Archived = PhantomData<(Archived<T>, R, C)>>
|
||||||
"))
|
")
|
||||||
|
)
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
|
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
|
||||||
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
||||||
|
|
|
@ -24,9 +24,12 @@ use crate::{Dim, Matrix, OMatrix, RealField, Scalar, SimdComplexField, SimdRealF
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "rkyv-serialize-no-std",
|
feature = "rkyv-serialize-no-std",
|
||||||
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
||||||
archive(as = "Unit<T::Archived>", bound(archive = "
|
archive(
|
||||||
|
as = "Unit<T::Archived>",
|
||||||
|
bound(archive = "
|
||||||
T: rkyv::Archive,
|
T: rkyv::Archive,
|
||||||
"))
|
")
|
||||||
|
)
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
|
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
|
||||||
// #[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
// #[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
||||||
|
|
|
@ -44,10 +44,13 @@ use simba::scalar::{ClosedNeg, RealField};
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "rkyv-serialize-no-std",
|
feature = "rkyv-serialize-no-std",
|
||||||
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
||||||
archive(as = "DualQuaternion<T::Archived>", bound(archive = "
|
archive(
|
||||||
|
as = "DualQuaternion<T::Archived>",
|
||||||
|
bound(archive = "
|
||||||
T: rkyv::Archive,
|
T: rkyv::Archive,
|
||||||
Quaternion<T>: rkyv::Archive<Archived = Quaternion<T::Archived>>
|
Quaternion<T>: rkyv::Archive<Archived = Quaternion<T::Archived>>
|
||||||
"))
|
")
|
||||||
|
)
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
||||||
pub struct DualQuaternion<T> {
|
pub struct DualQuaternion<T> {
|
||||||
|
|
|
@ -69,11 +69,14 @@ use crate::geometry::{AbstractRotation, Point, Translation};
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "rkyv-serialize-no-std",
|
feature = "rkyv-serialize-no-std",
|
||||||
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
||||||
archive(as = "Isometry<T::Archived, R::Archived, D>", bound(archive = "
|
archive(
|
||||||
|
as = "Isometry<T::Archived, R::Archived, D>",
|
||||||
|
bound(archive = "
|
||||||
T: rkyv::Archive,
|
T: rkyv::Archive,
|
||||||
R: rkyv::Archive,
|
R: rkyv::Archive,
|
||||||
Translation<T, D>: rkyv::Archive<Archived = Translation<T::Archived, D>>
|
Translation<T, D>: rkyv::Archive<Archived = Translation<T::Archived, D>>
|
||||||
"))
|
")
|
||||||
|
)
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
|
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
|
||||||
pub struct Isometry<T, R, const D: usize> {
|
pub struct Isometry<T, R, const D: usize> {
|
||||||
|
|
|
@ -23,10 +23,13 @@ use crate::geometry::{Point3, Projective3};
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "rkyv-serialize-no-std",
|
feature = "rkyv-serialize-no-std",
|
||||||
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
||||||
archive(as = "Orthographic3<T::Archived>", bound(archive = "
|
archive(
|
||||||
|
as = "Orthographic3<T::Archived>",
|
||||||
|
bound(archive = "
|
||||||
T: rkyv::Archive,
|
T: rkyv::Archive,
|
||||||
Matrix4<T>: rkyv::Archive<Archived = Matrix4<T::Archived>>
|
Matrix4<T>: rkyv::Archive<Archived = Matrix4<T::Archived>>
|
||||||
"))
|
")
|
||||||
|
)
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
|
|
|
@ -24,10 +24,13 @@ use crate::geometry::{Point3, Projective3};
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "rkyv-serialize-no-std",
|
feature = "rkyv-serialize-no-std",
|
||||||
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
||||||
archive(as = "Perspective3<T::Archived>", bound(archive = "
|
archive(
|
||||||
|
as = "Perspective3<T::Archived>",
|
||||||
|
bound(archive = "
|
||||||
T: rkyv::Archive,
|
T: rkyv::Archive,
|
||||||
Matrix4<T>: rkyv::Archive<Archived = Matrix4<T::Archived>>
|
Matrix4<T>: rkyv::Archive<Archived = Matrix4<T::Archived>>
|
||||||
"))
|
")
|
||||||
|
)
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
|
|
|
@ -27,10 +27,13 @@ use crate::geometry::{Point3, Rotation};
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "rkyv-serialize-no-std",
|
feature = "rkyv-serialize-no-std",
|
||||||
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
||||||
archive(as = "Quaternion<T::Archived>", bound(archive = "
|
archive(
|
||||||
|
as = "Quaternion<T::Archived>",
|
||||||
|
bound(archive = "
|
||||||
T: rkyv::Archive,
|
T: rkyv::Archive,
|
||||||
Vector4<T>: rkyv::Archive<Archived = Vector4<T::Archived>>
|
Vector4<T>: rkyv::Archive<Archived = Vector4<T::Archived>>
|
||||||
"))
|
")
|
||||||
|
)
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
||||||
pub struct Quaternion<T> {
|
pub struct Quaternion<T> {
|
||||||
|
|
|
@ -53,10 +53,13 @@ use crate::geometry::Point;
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "rkyv-serialize-no-std",
|
feature = "rkyv-serialize-no-std",
|
||||||
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
||||||
archive(as = "Rotation<T::Archived, D>", bound(archive = "
|
archive(
|
||||||
|
as = "Rotation<T::Archived, D>",
|
||||||
|
bound(archive = "
|
||||||
T: rkyv::Archive,
|
T: rkyv::Archive,
|
||||||
SMatrix<T, D, D>: rkyv::Archive<Archived = SMatrix<T::Archived, D, D>>
|
SMatrix<T, D, D>: rkyv::Archive<Archived = SMatrix<T::Archived, D, D>>
|
||||||
"))
|
")
|
||||||
|
)
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
|
|
|
@ -21,10 +21,13 @@ use crate::geometry::Point;
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "rkyv-serialize-no-std",
|
feature = "rkyv-serialize-no-std",
|
||||||
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
||||||
archive(as = "Scale<T::Archived, D>", bound(archive = "
|
archive(
|
||||||
|
as = "Scale<T::Archived, D>",
|
||||||
|
bound(archive = "
|
||||||
T: rkyv::Archive,
|
T: rkyv::Archive,
|
||||||
SVector<T, D>: rkyv::Archive<Archived = SVector<T::Archived, D>>
|
SVector<T, D>: rkyv::Archive<Archived = SVector<T::Archived, D>>
|
||||||
"))
|
")
|
||||||
|
)
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
|
|
|
@ -37,11 +37,14 @@ use crate::geometry::{AbstractRotation, Isometry, Point, Translation};
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "rkyv-serialize-no-std",
|
feature = "rkyv-serialize-no-std",
|
||||||
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
||||||
archive(as = "Similarity<T::Archived, R::Archived, D>", bound(archive = "
|
archive(
|
||||||
|
as = "Similarity<T::Archived, R::Archived, D>",
|
||||||
|
bound(archive = "
|
||||||
T: rkyv::Archive,
|
T: rkyv::Archive,
|
||||||
R: rkyv::Archive,
|
R: rkyv::Archive,
|
||||||
Isometry<T, R, D>: rkyv::Archive<Archived = Isometry<T::Archived, R::Archived, D>>
|
Isometry<T, R, D>: rkyv::Archive<Archived = Isometry<T::Archived, R::Archived, D>>
|
||||||
"))
|
")
|
||||||
|
)
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
|
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
|
||||||
pub struct Similarity<T, R, const D: usize> {
|
pub struct Similarity<T, R, const D: usize> {
|
||||||
|
|
|
@ -21,10 +21,13 @@ use crate::geometry::Point;
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "rkyv-serialize-no-std",
|
feature = "rkyv-serialize-no-std",
|
||||||
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
|
||||||
archive(as = "Translation<T::Archived, D>", bound(archive = "
|
archive(
|
||||||
|
as = "Translation<T::Archived, D>",
|
||||||
|
bound(archive = "
|
||||||
T: rkyv::Archive,
|
T: rkyv::Archive,
|
||||||
SVector<T, D>: rkyv::Archive<Archived = SVector<T::Archived, D>>
|
SVector<T, D>: rkyv::Archive<Archived = SVector<T::Archived, D>>
|
||||||
"))
|
")
|
||||||
|
)
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
|
|
|
@ -83,7 +83,11 @@ an optimized set of tools for computer graphics and physics. Those features incl
|
||||||
missing_copy_implementations
|
missing_copy_implementations
|
||||||
)]
|
)]
|
||||||
#![cfg_attr(feature = "rkyv-serialize-no-std", allow(unused_results))] // TODO: deny this once bytecheck stops generating warnings.
|
#![cfg_attr(feature = "rkyv-serialize-no-std", allow(unused_results))] // TODO: deny this once bytecheck stops generating warnings.
|
||||||
#![cfg_attr(not(feature = "rkyv-serialize-no-std"), deny(unused_results), deny(unused_qualifications))] // TODO: deny this globally
|
#![cfg_attr(
|
||||||
|
not(feature = "rkyv-serialize-no-std"),
|
||||||
|
deny(unused_results),
|
||||||
|
deny(unused_qualifications)
|
||||||
|
)] // TODO: deny this globally
|
||||||
#![doc(
|
#![doc(
|
||||||
html_favicon_url = "https://nalgebra.org/img/favicon.ico",
|
html_favicon_url = "https://nalgebra.org/img/favicon.ico",
|
||||||
html_root_url = "https://docs.rs/nalgebra/0.25.0"
|
html_root_url = "https://docs.rs/nalgebra/0.25.0"
|
||||||
|
|
|
@ -7,8 +7,8 @@ mod matrix;
|
||||||
mod matrix_slice;
|
mod matrix_slice;
|
||||||
#[cfg(feature = "mint")]
|
#[cfg(feature = "mint")]
|
||||||
mod mint;
|
mod mint;
|
||||||
mod serde;
|
|
||||||
mod rkyv;
|
mod rkyv;
|
||||||
|
mod serde;
|
||||||
|
|
||||||
#[cfg(feature = "compare")]
|
#[cfg(feature = "compare")]
|
||||||
mod matrixcompare;
|
mod matrixcompare;
|
||||||
|
|
|
@ -6,7 +6,7 @@ use na::{
|
||||||
SimilarityMatrix3, Translation2, Translation3, Unit, Vector2,
|
SimilarityMatrix3, Translation2, Translation3, Unit, Vector2,
|
||||||
};
|
};
|
||||||
use rand;
|
use rand;
|
||||||
use rkyv::{Archive, Serialize, Deserialize, Infallible};
|
use rkyv::{Archive, Deserialize, Infallible, Serialize};
|
||||||
|
|
||||||
macro_rules! test_rkyv_archived_impls(
|
macro_rules! test_rkyv_archived_impls(
|
||||||
($($test: ident, $ty: ident);* $(;)*) => {$(
|
($($test: ident, $ty: ident);* $(;)*) => {$(
|
||||||
|
|
Loading…
Reference in New Issue