Skip to content

Commit f1f544a

Browse files
committed
Mock mock module to rngs/mock
1 parent f4de862 commit f1f544a

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

src/distributions/float.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ float_impls! { f64, u64, 52, 1023 }
148148
mod tests {
149149
use Rng;
150150
use distributions::{Open01, OpenClosed01};
151-
use mock::StepRng;
151+
use rngs::mock::StepRng;
152152

153153
const EPSILON32: f32 = ::core::f32::EPSILON;
154154
const EPSILON64: f64 = ::core::f64::EPSILON;

src/distributions/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ fn ziggurat<R: Rng + ?Sized, P, Z>(
622622
#[cfg(test)]
623623
mod tests {
624624
use Rng;
625-
use mock::StepRng;
625+
use rngs::mock::StepRng;
626626
use super::{WeightedChoice, Weighted, Distribution};
627627

628628
#[test]

src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,6 @@ pub use rand_core::{ErrorKind, Error};
211211

212212
// Public modules
213213
pub mod distributions;
214-
pub mod mock; // Public so we don't export `StepRng` directly, making it a bit
215-
// more clear it is intended for testing.
216214
pub mod prelude;
217215
pub mod prng;
218216
pub mod rngs;
@@ -933,7 +931,7 @@ pub fn sample<T, I, R>(rng: &mut R, iterable: I, amount: usize) -> Vec<T>
933931

934932
#[cfg(test)]
935933
mod test {
936-
use mock::StepRng;
934+
use rngs::mock::StepRng;
937935
use super::*;
938936
#[cfg(all(not(feature="std"), feature="alloc"))] use alloc::boxed::Box;
939937

src/rngs/adaptor/reseeding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ where R: BlockRngCore + SeedableRng + CryptoRng,
224224
mod test {
225225
use {Rng, SeedableRng};
226226
use prng::chacha::ChaChaCore;
227-
use mock::StepRng;
227+
use rngs::mock::StepRng;
228228
use super::ReseedingRng;
229229

230230
#[test]

src/mock.rs renamed to src/rngs/mock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use rand_core::{RngCore, Error, impls};
2020
///
2121
/// ```rust
2222
/// use rand::Rng;
23-
/// use rand::mock::StepRng;
23+
/// use rand::rngs::mock::StepRng;
2424
///
2525
/// let mut my_rng = StepRng::new(2, 1);
2626
/// let sample: [u64; 3] = my_rng.gen();

src/rngs/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ pub mod adaptor;
1414

1515
#[cfg(feature="std")] mod entropy;
1616
#[doc(hidden)] pub mod jitter;
17+
pub mod mock; // Public so we don't export `StepRng` directly, making it a bit
18+
// more clear it is intended for testing.
1719
#[cfg(feature="std")] #[doc(hidden)] pub mod os;
1820
mod small;
1921
mod std;

0 commit comments

Comments
 (0)