Skip to content

Commit 8f4e456

Browse files
committed
rand_core: Fix serde1 feature
1 parent 294d16c commit 8f4e456

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rand_core/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ appveyor = { repository = "rust-random/rand" }
2121
[features]
2222
std = ["alloc", "getrandom", "getrandom/std"] # use std library; should be default but for above bug
2323
alloc = [] # enables Vec and Box support without std
24-
serde1 = ["serde", "serde_derive"] # enables serde for BlockRng wrapper
24+
serde1 = ["serde"] # enables serde for BlockRng wrapper
2525

2626
[dependencies]
27-
serde = { version = "1", optional = true }
28-
serde_derive = { version = "^1.0.38", optional = true }
27+
serde = { version = "1", features = ["derive"], optional = true }
2928
getrandom = { version = "0.1", optional = true }

rand_core/src/block.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
5353
use core::convert::AsRef;
5454
use core::{fmt, ptr};
55+
#[cfg(feature="serde1")] use serde::{Serialize, Deserialize};
5556
use crate::{RngCore, CryptoRng, SeedableRng, Error};
5657
use crate::impls::{fill_via_u32_chunks, fill_via_u64_chunks};
5758

0 commit comments

Comments
 (0)