Skip to content

Commit 36df148

Browse files
committed
lib: reorder use/mod declarations
1 parent 06d2645 commit 36df148

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/lib.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,16 @@ use core::mem;
257257
#[cfg(feature="std")] use std::io;
258258
#[cfg(feature="std")] use std::rc::Rc;
259259

260+
// external rngs
260261
pub use jitter::JitterRng;
261262
#[cfg(feature="std")] pub use os::OsRng;
262263

264+
// pseudo rngs
263265
pub use isaac::{IsaacRng, Isaac64Rng};
264266
pub use chacha::ChaChaRng;
267+
pub use prng::XorShiftRng;
265268

269+
// local use declarations
266270
#[cfg(target_pointer_width = "32")]
267271
use prng::IsaacRng as IsaacWordRng;
268272
#[cfg(target_pointer_width = "64")]
@@ -271,16 +275,13 @@ use prng::Isaac64Rng as IsaacWordRng;
271275
use distributions::{Range, IndependentSample};
272276
use distributions::range::SampleRange;
273277

274-
pub use prng::XorShiftRng;
275-
278+
// public modules
276279
pub mod distributions;
277-
pub mod reseeding;
278-
mod rand_impls;
279280
pub mod jitter;
280281
#[cfg(feature="std")] pub mod os;
281282
#[cfg(feature="std")] pub mod read;
283+
pub mod reseeding;
282284
#[cfg(any(feature="std", feature = "alloc"))] pub mod seq;
283-
mod prng;
284285

285286
// These tiny modules are here to avoid API breakage, probably only temporarily
286287
pub mod chacha {
@@ -292,6 +293,11 @@ pub mod isaac {
292293
pub use prng::{IsaacRng, Isaac64Rng};
293294
}
294295

296+
// private modules
297+
mod rand_impls;
298+
mod prng;
299+
300+
295301
/// A type that can be randomly generated using an `Rng`.
296302
///
297303
/// ## Built-in Implementations
@@ -324,7 +330,6 @@ pub mod isaac {
324330
/// independently, using its own `Rand` implementation.
325331
/// * `Option<T>`: Returns `None` with probability 0.5; otherwise generates a
326332
/// random `T` and returns `Some(T)`.
327-
328333
pub trait Rand : Sized {
329334
/// Generates a random instance of this type using the specified source of
330335
/// randomness.

0 commit comments

Comments
 (0)