Skip to content

Commit

Permalink
Do not impl serde for ReadRng or ReseedingRng
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardy committed Jun 7, 2021
1 parent 4726d32 commit e3bc4a1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/rngs/adapter/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ use rand_core::{impls, Error, RngCore};
/// [`OsRng`]: crate::rngs::OsRng
/// [`try_fill_bytes`]: RngCore::try_fill_bytes
#[derive(Debug)]
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
pub struct ReadRng<R> {
reader: R,
}
Expand Down
10 changes: 0 additions & 10 deletions src/rngs/adapter/reseeding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ use core::mem::size_of;

use rand_core::block::{BlockRng, BlockRngCore};
use rand_core::{CryptoRng, Error, RngCore, SeedableRng};
#[cfg(feature = "serde1")]
use serde::{Deserialize, Serialize};

/// A wrapper around any PRNG that implements [`BlockRngCore`], that adds the
/// ability to reseed it.
Expand Down Expand Up @@ -78,13 +76,6 @@ use serde::{Deserialize, Serialize};
/// [`ReseedingRng::new`]: ReseedingRng::new
/// [`reseed()`]: ReseedingRng::reseed
#[derive(Debug)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
#[cfg_attr(
feature = "serde1",
serde(
bound = "for<'x> R: Serialize + Deserialize<'x> + Sized, for<'x> R::Results: Serialize + Deserialize<'x>, for<'x> Rsdr: Serialize + Deserialize<'x>"
)
)]
pub struct ReseedingRng<R, Rsdr>(BlockRng<ReseedingCore<R, Rsdr>>)
where
R: BlockRngCore + SeedableRng,
Expand Down Expand Up @@ -157,7 +148,6 @@ where
}

#[derive(Debug)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
struct ReseedingCore<R, Rsdr> {
inner: R,
reseeder: Rsdr,
Expand Down

0 comments on commit e3bc4a1

Please sign in to comment.