Skip to content

Commit 887e079

Browse files
committed
Remove optional feature serde
1 parent 4d22ab2 commit 887e079

File tree

4 files changed

+4
-21
lines changed

4 files changed

+4
-21
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ jobs:
9696
cargo generate-lockfile -Z minimal-versions
9797
- name: Test rand_core
9898
run: |
99-
cargo test --target ${{ matrix.target }} --no-default-features
100-
cargo test --target ${{ matrix.target }} --features serde
99+
cargo test --target ${{ matrix.target }}
101100
102101
test-cross:
103102
runs-on: ${{ matrix.os }}
@@ -137,11 +136,9 @@ jobs:
137136
rustup toolchain install nightly --component miri
138137
rustup override set nightly
139138
cargo miri setup
140-
- name: Test rand
139+
- name: Test (miri)
141140
run: |
142141
cargo miri test
143-
cargo miri test --features=serde
144-
cargo miri test --no-default-features
145142
146143
test-no-std:
147144
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- Remove feature `os_rng`, structs `OsRng` and `OsError` and fns `from_os_rng`, `try_from_os_rng` ([rand#1674])
1414
- Remove feature `std` ([rand#1674])
1515
- Removed dependency `getrandom` ([rand#1674])
16+
- Removed optional dependency `serde` ([#28])
1617
- Add `SeedableRng::fork` methods ([#17])
1718
### Other
1819
- 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
2526
[rand#1669]: https://github.com/rust-random/rand/pull/1669
2627
[rand#1674]: https://github.com/rust-random/rand/pull/1674
2728
[#17]: https://github.com/rust-random/rand-core/pull/17
29+
[#28]: https://github.com/rust-random/rand-core/pull/28
2830

2931
[rust-random/rand]: https://github.com/rust-random/rand
3032
[rust-random/core]: https://github.com/rust-random/core

Cargo.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,3 @@ rustdoc-args = ["--generate-link-to-definition"]
2424

2525
[package.metadata.playground]
2626
all-features = true
27-
28-
[features]
29-
serde = ["dep:serde"] # enables serde for BlockRng wrapper
30-
31-
[dependencies]
32-
serde = { version = "1.0.103", features = ["derive"], optional = true }

src/block.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@
4848
use crate::le::fill_via_chunks;
4949
use crate::{CryptoRng, RngCore, SeedableRng, TryRngCore};
5050
use core::fmt;
51-
#[cfg(feature = "serde")]
52-
use serde::{Deserialize, Serialize};
5351

5452
/// A trait for RNGs which do not generate random numbers individually, but in
5553
/// blocks (typically `[u32; N]`). This technique is commonly used by
@@ -108,13 +106,6 @@ pub trait CryptoBlockRng: BlockRngCore {}
108106
/// [`next_u64`]: RngCore::next_u64
109107
/// [`fill_bytes`]: RngCore::fill_bytes
110108
#[derive(Clone)]
111-
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
112-
#[cfg_attr(
113-
feature = "serde",
114-
serde(
115-
bound = "for<'x> R: Serialize + Deserialize<'x>, for<'x> R::Results: Serialize + Deserialize<'x>"
116-
)
117-
)]
118109
pub struct BlockRng<R: BlockRngCore> {
119110
results: R::Results,
120111
index: usize,
@@ -273,7 +264,6 @@ impl<R: CryptoBlockRng + BlockRngCore<Item = u32>> CryptoRng for BlockRng<R> {}
273264
/// [`next_u64`]: RngCore::next_u64
274265
/// [`fill_bytes`]: RngCore::fill_bytes
275266
#[derive(Clone)]
276-
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
277267
pub struct BlockRng64<R: BlockRngCore + ?Sized> {
278268
results: R::Results,
279269
index: usize,

0 commit comments

Comments
 (0)