From c63503de04d905d6a8df8dc3c41a2e080ba060d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sun, 9 Jul 2023 11:36:44 +0200 Subject: [PATCH] chore: remove explicit bytecheck dependency --- Cargo.toml | 5 ++--- src/base/array_storage.rs | 3 +++ src/base/dimension.rs | 2 ++ src/base/matrix.rs | 2 ++ src/base/unit.rs | 3 +++ src/geometry/dual_quaternion.rs | 3 +++ src/geometry/isometry.rs | 3 +++ src/geometry/orthographic.rs | 3 +++ src/geometry/perspective.rs | 3 +++ src/geometry/point.rs | 2 ++ src/geometry/quaternion.rs | 3 +++ src/geometry/rotation.rs | 3 +++ src/geometry/scale.rs | 3 +++ src/geometry/similarity.rs | 3 +++ src/geometry/translation.rs | 3 +++ 15 files changed, 41 insertions(+), 3 deletions(-) mode change 100755 => 100644 src/geometry/isometry.rs mode change 100755 => 100644 src/geometry/quaternion.rs mode change 100755 => 100644 src/geometry/rotation.rs mode change 100755 => 100644 src/geometry/scale.rs mode change 100755 => 100644 src/geometry/similarity.rs mode change 100755 => 100644 src/geometry/translation.rs diff --git a/Cargo.toml b/Cargo.toml index dfdc0250..4839cd2e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 } diff --git a/src/base/array_storage.rs b/src/base/array_storage.rs index dbc5e1d5..56e88d47 100644 --- a/src/base/array_storage.rs +++ b/src/base/array_storage.rs @@ -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}; diff --git a/src/base/dimension.rs b/src/base/dimension.rs index 97616129..11743dd8 100644 --- a/src/base/dimension.rs +++ b/src/base/dimension.rs @@ -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}; diff --git a/src/base/matrix.rs b/src/base/matrix.rs index dcac7423..af5609df 100644 --- a/src/base/matrix.rs +++ b/src/base/matrix.rs @@ -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}; diff --git a/src/base/unit.rs b/src/base/unit.rs index 2fc51107..12c70963 100644 --- a/src/base/unit.rs +++ b/src/base/unit.rs @@ -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:** diff --git a/src/geometry/dual_quaternion.rs b/src/geometry/dual_quaternion.rs index bae04f46..2272b622 100644 --- a/src/geometry/dual_quaternion.rs +++ b/src/geometry/dual_quaternion.rs @@ -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, diff --git a/src/geometry/isometry.rs b/src/geometry/isometry.rs old mode 100755 new mode 100644 index e3f44075..376af06f --- a/src/geometry/isometry.rs +++ b/src/geometry/isometry.rs @@ -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. diff --git a/src/geometry/orthographic.rs b/src/geometry/orthographic.rs index 06d0b471..2d809fe4 100644 --- a/src/geometry/orthographic.rs +++ b/src/geometry/orthographic.rs @@ -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( diff --git a/src/geometry/perspective.rs b/src/geometry/perspective.rs index a5fc19a8..383c99b9 100644 --- a/src/geometry/perspective.rs +++ b/src/geometry/perspective.rs @@ -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( diff --git a/src/geometry/point.rs b/src/geometry/point.rs index 8e950816..e936c3da 100644 --- a/src/geometry/point.rs +++ b/src/geometry/point.rs @@ -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}; diff --git a/src/geometry/quaternion.rs b/src/geometry/quaternion.rs old mode 100755 new mode 100644 index bb86a6e1..7dcbce51 --- a/src/geometry/quaternion.rs +++ b/src/geometry/quaternion.rs @@ -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` for a quaternion /// that may be used as a rotation. #[repr(C)] diff --git a/src/geometry/rotation.rs b/src/geometry/rotation.rs old mode 100755 new mode 100644 index 5eceec21..67a242cb --- a/src/geometry/rotation.rs +++ b/src/geometry/rotation.rs @@ -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. diff --git a/src/geometry/scale.rs b/src/geometry/scale.rs old mode 100755 new mode 100644 index 36a68066..c95c0967 --- a/src/geometry/scale.rs +++ b/src/geometry/scale.rs @@ -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( diff --git a/src/geometry/similarity.rs b/src/geometry/similarity.rs old mode 100755 new mode 100644 index 989b721b..4d931947 --- a/src/geometry/similarity.rs +++ b/src/geometry/similarity.rs @@ -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)] diff --git a/src/geometry/translation.rs b/src/geometry/translation.rs old mode 100755 new mode 100644 index 39fae3b6..4fc50777 --- a/src/geometry/translation.rs +++ b/src/geometry/translation.rs @@ -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(