diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e4549e6b..ad3550b8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -96,8 +96,7 @@ jobs: cargo generate-lockfile -Z minimal-versions - name: Test rand_core run: | - cargo test --target ${{ matrix.target }} --no-default-features - cargo test --target ${{ matrix.target }} --features serde + cargo test --target ${{ matrix.target }} test-cross: runs-on: ${{ matrix.os }} @@ -137,11 +136,9 @@ jobs: rustup toolchain install nightly --component miri rustup override set nightly cargo miri setup - - name: Test rand + - name: Test (miri) run: | cargo miri test - cargo miri test --features=serde - cargo miri test --no-default-features test-no-std: runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c801d24..5f195af0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Remove feature `os_rng`, structs `OsRng` and `OsError` and fns `from_os_rng`, `try_from_os_rng` ([rand#1674]) - Remove feature `std` ([rand#1674]) - Removed dependency `getrandom` ([rand#1674]) +- Removed optional dependency `serde` ([#28]) - Add `SeedableRng::fork` methods ([#17]) ### Other - Changed repository from [rust-random/rand] to [rust-random/core]. @@ -25,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [rand#1669]: https://github.com/rust-random/rand/pull/1669 [rand#1674]: https://github.com/rust-random/rand/pull/1674 [#17]: https://github.com/rust-random/rand-core/pull/17 +[#28]: https://github.com/rust-random/rand-core/pull/28 [rust-random/rand]: https://github.com/rust-random/rand [rust-random/core]: https://github.com/rust-random/core diff --git a/Cargo.toml b/Cargo.toml index 22f66d0a..6cae9217 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,9 +24,3 @@ rustdoc-args = ["--generate-link-to-definition"] [package.metadata.playground] all-features = true - -[features] -serde = ["dep:serde"] # enables serde for BlockRng wrapper - -[dependencies] -serde = { version = "1.0.103", features = ["derive"], optional = true } diff --git a/src/block.rs b/src/block.rs index b9c722ab..2cba57e0 100644 --- a/src/block.rs +++ b/src/block.rs @@ -48,8 +48,6 @@ use crate::le::fill_via_chunks; use crate::{CryptoRng, RngCore, SeedableRng, TryRngCore}; use core::fmt; -#[cfg(feature = "serde")] -use serde::{Deserialize, Serialize}; /// A trait for RNGs which do not generate random numbers individually, but in /// blocks (typically `[u32; N]`). This technique is commonly used by @@ -108,13 +106,6 @@ pub trait CryptoBlockRng: BlockRngCore {} /// [`next_u64`]: RngCore::next_u64 /// [`fill_bytes`]: RngCore::fill_bytes #[derive(Clone)] -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] -#[cfg_attr( - feature = "serde", - serde( - bound = "for<'x> R: Serialize + Deserialize<'x>, for<'x> R::Results: Serialize + Deserialize<'x>" - ) -)] pub struct BlockRng { results: R::Results, index: usize, @@ -273,7 +264,6 @@ impl> CryptoRng for BlockRng {} /// [`next_u64`]: RngCore::next_u64 /// [`fill_bytes`]: RngCore::fill_bytes #[derive(Clone)] -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct BlockRng64 { results: R::Results, index: usize,