Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand All @@ -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
Expand Down
6 changes: 0 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
10 changes: 0 additions & 10 deletions src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<R: BlockRngCore> {
results: R::Results,
index: usize,
Expand Down Expand Up @@ -273,7 +264,6 @@ impl<R: CryptoBlockRng + BlockRngCore<Item = u32>> CryptoRng for BlockRng<R> {}
/// [`next_u64`]: RngCore::next_u64
/// [`fill_bytes`]: RngCore::fill_bytes
#[derive(Clone)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct BlockRng64<R: BlockRngCore + ?Sized> {
results: R::Results,
index: usize,
Expand Down