Skip to content

Commit

Permalink
Allow unsized BlockRngCore
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardy committed Mar 15, 2018
1 parent 4172c6e commit 07f51bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rand-core/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@ pub fn next_u64_via_fill<R: RngCore + ?Sized>(rng: &mut R) -> u64 {
/// [`RngCore`]: ../RngCore.t.html
/// [`SeedableRng`]: ../SeedableRng.t.html
#[derive(Clone)]
pub struct BlockRng<R: BlockRngCore> {
pub core: R,
pub struct BlockRng<R: BlockRngCore + ?Sized> {
pub results: R::Results,
pub index: usize,
pub core: R,
}

// Custom Debug implementation that does not expose the contents of `results`.
Expand Down
2 changes: 1 addition & 1 deletion rand-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ pub trait RngCore {
/// // Final RNG.
/// type MyRng = BlockRng<u32, MyRngCore>;
/// ```
pub trait BlockRngCore: Sized {
pub trait BlockRngCore {
/// Results element type, e.g. `u32`.
type Item;

Expand Down

0 comments on commit 07f51bc

Please sign in to comment.