diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9d875a4..8dcc65a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -2,18 +2,18 @@ name: CI on: merge_group jobs: - test: name: Test runs-on: ubuntu-latest strategy: matrix: rust: [ - 1.60.0, # MSRV - stable, - beta, - nightly - ] + 1.60.0, # MSRV + 1.81.0, # rkyv + stable, + beta, + nightly + ] steps: - uses: actions/checkout@v4 - uses: actions/cache@v4 diff --git a/Cargo.toml b/Cargo.toml index 987784c..fd34cad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ edition = "2021" rust-version = "1.60" [package.metadata.docs.rs] -features = ["bytemuck", "std", "serde", "rkyv/size_64", "bytecheck", "rand"] +features = ["bytemuck", "std", "serde", "rkyv", "rand"] [dependencies] @@ -35,13 +35,12 @@ default-features = false [dependencies.rkyv] optional = true -version = "0.7" +version = "0.8" default-features = false [dependencies.bytecheck] optional = true -version = "0.6" -default-features = false +version = "0.8" [dependencies.rand] optional = true @@ -52,8 +51,7 @@ default-features = false default = ["std"] std = ["num-traits/std"] libm = ["num-traits/libm"] -bytecheck = ["dep:bytecheck"] bytemuck = ["dep:bytemuck"] rand = ["dep:rand"] -rkyv = ["dep:rkyv"] +rkyv = ["dep:rkyv", "rkyv/bytecheck", "dep:bytecheck"] serde = ["dep:serde"] diff --git a/ci/test_full.sh b/ci/test_full.sh index 23369ab..42ff287 100755 --- a/ci/test_full.sh +++ b/ci/test_full.sh @@ -27,7 +27,8 @@ if ! check_version $MSRV ; then exit 1 fi -FEATURES=(bytecheck bytemuck libm rand rkyv/size_64 serde) +FEATURES=(bytemuck libm rand serde) +check_version 1.81.0 && FEATURES+=(rkyv) echo "Testing supported features: ${FEATURES[*]}" cargo generate-lockfile diff --git a/src/lib.rs b/src/lib.rs index 661b67b..7cc9df5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -81,10 +81,9 @@ pub use crate::crand::ComplexDistribution; #[repr(C)] #[cfg_attr( feature = "rkyv", - derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) + derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize, rkyv::Portable, bytecheck::CheckBytes), + rkyv(as = Complex) )] -#[cfg_attr(feature = "rkyv", archive(as = "Complex"))] -#[cfg_attr(feature = "bytecheck", derive(bytecheck::CheckBytes))] pub struct Complex { /// Real portion of the complex number pub re: T, @@ -2404,7 +2403,7 @@ pub(crate) mod test { } #[test] - fn test_hyperbolic_identites() { + fn test_hyperbolic_identities() { for &c in all_consts.iter() { // tanh(z) = sinh(z)/cosh(z) assert!(close(c.tanh(), c.sinh() / c.cosh()));