Skip to content

Commit

Permalink
chore: remove explicit bytecheck dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
sebcrozet committed Jul 9, 2023
1 parent e3443ca commit c63503d
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }
Expand Down
3 changes: 3 additions & 0 deletions src/base/array_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 2 additions & 0 deletions src/base/dimension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
2 changes: 2 additions & 0 deletions src/base/matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
3 changes: 3 additions & 0 deletions src/base/unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:**
Expand Down
3 changes: 3 additions & 0 deletions src/geometry/dual_quaternion.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
3 changes: 3 additions & 0 deletions src/geometry/isometry.rs
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions src/geometry/orthographic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 3 additions & 0 deletions src/geometry/perspective.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 2 additions & 0 deletions src/geometry/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
3 changes: 3 additions & 0 deletions src/geometry/quaternion.rs
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
3 changes: 3 additions & 0 deletions src/geometry/rotation.rs
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions src/geometry/scale.rs
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 3 additions & 0 deletions src/geometry/similarity.rs
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
3 changes: 3 additions & 0 deletions src/geometry/translation.rs
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit c63503d

Please sign in to comment.