Skip to content

Commit

Permalink
Tweak docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardy committed Nov 21, 2024
1 parent f3c50db commit d530ee8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/rngs/small.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ type Rng = super::xoshiro256plusplus::Xoshiro256PlusPlus;
/// let rng = SmallRng::from_rng(&mut rand::rng());
/// # let _: SmallRng = rng;
/// ```
/// or [`SeedableRng::from_os_rng`]:
/// ```
/// # use rand::SeedableRng;
/// # use rand::rngs::SmallRng;
/// let rng = SmallRng::from_os_rng();
/// # let _: SmallRng = rng;
/// ```
/// 2. To use a deterministic integral seed, use `seed_from_u64`. This uses a
/// hash function internally to yield a (typically) good seed from any
/// input.
Expand Down
2 changes: 1 addition & 1 deletion src/rngs/std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use rand_chacha::ChaCha12Rng as Rng;
/// # let _: StdRng = rng;
/// ```
///
/// Seeding via [`rand::rng`] may be faster:
/// Seeding via [`rand::rng()`](crate::rng()) may be faster:
/// ```
/// # use rand::{SeedableRng, rngs::StdRng};
/// let rng = StdRng::from_rng(&mut rand::rng());
Expand Down

0 comments on commit d530ee8

Please sign in to comment.