From e3bc4a1357b7ccf023af268f1d2a828926713e6f Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Mon, 7 Jun 2021 17:50:03 +0100 Subject: [PATCH] Do not impl serde for ReadRng or ReseedingRng --- src/rngs/adapter/read.rs | 1 - src/rngs/adapter/reseeding.rs | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/src/rngs/adapter/read.rs b/src/rngs/adapter/read.rs index c623e4e13be..63b0dd0c0f0 100644 --- a/src/rngs/adapter/read.rs +++ b/src/rngs/adapter/read.rs @@ -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 { reader: R, } diff --git a/src/rngs/adapter/reseeding.rs b/src/rngs/adapter/reseeding.rs index 36b492a57f3..70b0b82307f 100644 --- a/src/rngs/adapter/reseeding.rs +++ b/src/rngs/adapter/reseeding.rs @@ -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. @@ -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(BlockRng>) where R: BlockRngCore + SeedableRng, @@ -157,7 +148,6 @@ where } #[derive(Debug)] -#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] struct ReseedingCore { inner: R, reseeder: Rsdr,