chore: remove explicit bytecheck dependency

This commit is contained in:
Sébastien Crozet 2023-07-09 11:36:44 +02:00
parent e3443ca213
commit c63503de04
No known key found for this signature in database
GPG Key ID: 92EBE6CA51F3D534
15 changed files with 41 additions and 3 deletions

View File

@ -58,7 +58,7 @@ convert-glam024 = [ "glam024" ]
serde-serialize-no-std = [ "serde", "num-complex/serde" ]
serde-serialize = [ "serde-serialize-no-std", "serde/std" ]
rkyv-serialize-no-std = [ "rkyv/size_32" ]
rkyv-serialize = [ "rkyv-serialize-no-std", "rkyv/std", "rkyv/validation", "bytecheck" ]
rkyv-serialize = [ "rkyv-serialize-no-std", "rkyv/std", "rkyv/validation" ]
# Randomness
## To use rand in a #[no-std] environment, enable the
@ -85,8 +85,7 @@ alga = { version = "0.9", default-features = false, optional = true }
rand_distr = { version = "0.4", default-features = false, optional = true }
matrixmultiply = { version = "0.3", optional = true }
serde = { version = "1.0", default-features = false, features = [ "derive" ], optional = true }
rkyv = { version = "0.7", default-features = false, optional = true }
bytecheck = { version = "~0.6.1", optional = true }
rkyv = { version = "0.7.41", default-features = false, optional = true }
mint = { version = "0.5", optional = true }
quickcheck = { version = "1", optional = true }
pest = { version = "2", optional = true }

View File

@ -11,6 +11,9 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};
#[cfg(feature = "serde-serialize-no-std")]
use std::marker::PhantomData;
#[cfg(feature = "rkyv-serialize")]
use rkyv::bytecheck;
use crate::base::allocator::Allocator;
use crate::base::default_allocator::DefaultAllocator;
use crate::base::dimension::{Const, ToTypenum};

View File

@ -8,6 +8,8 @@ use std::fmt::Debug;
use std::ops::{Add, Div, Mul, Sub};
use typenum::{self, Diff, Max, Maximum, Min, Minimum, Prod, Quot, Sum, Unsigned};
#[cfg(feature = "rkyv-serialize")]
use rkyv::bytecheck;
#[cfg(feature = "serde-serialize-no-std")]
use serde::{Deserialize, Deserializer, Serialize, Serializer};

View File

@ -13,6 +13,8 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};
#[cfg(feature = "rkyv-serialize-no-std")]
use super::rkyv_wrappers::CustomPhantom;
#[cfg(feature = "rkyv-serialize")]
use rkyv::bytecheck;
#[cfg(feature = "rkyv-serialize-no-std")]
use rkyv::{with::With, Archive, Archived};

View File

@ -9,6 +9,9 @@ use crate::base::DefaultAllocator;
use crate::storage::RawStorage;
use crate::{Dim, Matrix, OMatrix, RealField, Scalar, SimdComplexField, SimdRealField};
#[cfg(feature = "rkyv-serialize")]
use rkyv::bytecheck;
/// A wrapper that ensures the underlying algebraic entity has a unit norm.
///
/// **It is likely that the only piece of documentation that you need in this page are:**

View File

@ -1,6 +1,9 @@
// The macros break if the references are taken out, for some reason.
#![allow(clippy::op_ref)]
#[cfg(feature = "rkyv-serialize")]
use rkyv::bytecheck;
use crate::{
Isometry3, Matrix4, Normed, OVector, Point3, Quaternion, Scalar, SimdRealField, Translation3,
Unit, UnitQuaternion, Vector3, Zero, U8,

3
src/geometry/isometry.rs Executable file → Normal file
View File

@ -14,6 +14,9 @@ use crate::base::storage::Owned;
use crate::base::{Const, DefaultAllocator, OMatrix, SVector, Scalar, Unit};
use crate::geometry::{AbstractRotation, Point, Translation};
#[cfg(feature = "rkyv-serialize")]
use rkyv::bytecheck;
/// A direct isometry, i.e., a rotation followed by a translation (aka. a rigid-body motion).
///
/// This is also known as an element of a Special Euclidean (SE) group.

View File

@ -17,6 +17,9 @@ use crate::base::{Matrix4, Vector, Vector3};
use crate::geometry::{Point3, Projective3};
#[cfg(feature = "rkyv-serialize")]
use rkyv::bytecheck;
/// A 3D orthographic projection stored as a homogeneous 4x4 matrix.
#[repr(C)]
#[cfg_attr(

View File

@ -18,6 +18,9 @@ use crate::base::{Matrix4, Vector, Vector3};
use crate::geometry::{Point3, Projective3};
#[cfg(feature = "rkyv-serialize")]
use rkyv::bytecheck;
/// A 3D perspective projection stored as a homogeneous 4x4 matrix.
#[repr(C)]
#[cfg_attr(

View File

@ -4,6 +4,8 @@ use std::cmp::Ordering;
use std::fmt;
use std::hash;
#[cfg(feature = "rkyv-serialize")]
use rkyv::bytecheck;
#[cfg(feature = "serde-serialize-no-std")]
use serde::{Deserialize, Deserializer, Serialize, Serializer};

3
src/geometry/quaternion.rs Executable file → Normal file
View File

@ -19,6 +19,9 @@ use crate::base::{
use crate::geometry::{Point3, Rotation};
#[cfg(feature = "rkyv-serialize")]
use rkyv::bytecheck;
/// A quaternion. See the type alias `UnitQuaternion = Unit<Quaternion>` for a quaternion
/// that may be used as a rotation.
#[repr(C)]

3
src/geometry/rotation.rs Executable file → Normal file
View File

@ -17,6 +17,9 @@ use crate::base::dimension::{DimNameAdd, DimNameSum, U1};
use crate::base::{Const, DefaultAllocator, OMatrix, SMatrix, SVector, Scalar, Unit};
use crate::geometry::Point;
#[cfg(feature = "rkyv-serialize")]
use rkyv::bytecheck;
/// A rotation matrix.
///
/// This is also known as an element of a Special Orthogonal (SO) group.

3
src/geometry/scale.rs Executable file → Normal file
View File

@ -15,6 +15,9 @@ use crate::ClosedMul;
use crate::geometry::Point;
#[cfg(feature = "rkyv-serialize")]
use rkyv::bytecheck;
/// A scale which supports non-uniform scaling.
#[repr(C)]
#[cfg_attr(

3
src/geometry/similarity.rs Executable file → Normal file
View File

@ -15,6 +15,9 @@ use crate::base::storage::Owned;
use crate::base::{Const, DefaultAllocator, OMatrix, SVector, Scalar};
use crate::geometry::{AbstractRotation, Isometry, Point, Translation};
#[cfg(feature = "rkyv-serialize")]
use rkyv::bytecheck;
/// A similarity, i.e., an uniform scaling, followed by a rotation, followed by a translation.
#[repr(C)]
#[derive(Debug, Copy, Clone)]

3
src/geometry/translation.rs Executable file → Normal file
View File

@ -15,6 +15,9 @@ use crate::base::{Const, DefaultAllocator, OMatrix, SVector, Scalar};
use crate::geometry::Point;
#[cfg(feature = "rkyv-serialize")]
use rkyv::bytecheck;
/// A translation.
#[repr(C)]
#[cfg_attr(