@@ -260,11 +260,12 @@ pub mod isaac {
260
260
#[ cfg( feature="std" ) ] mod thread_rng;
261
261
262
262
263
- /// A type that can be randomly generated using an `Rng`.
263
+ /// A type that can be randomly generated using an [ `Rng`] .
264
264
///
265
265
/// This is merely an adaptor around the [`Uniform`] distribution for
266
266
/// convenience and backwards-compatibility.
267
267
///
268
+ /// [`Rng`]: trait.Rng.html
268
269
/// [`Uniform`]: distributions/struct.Uniform.html
269
270
#[ deprecated( since="0.5.0" , note="replaced by distributions::Uniform" ) ]
270
271
pub trait Rand : Sized {
@@ -734,7 +735,7 @@ impl<R: RngCore> Iterator for AsciiGenerator<R> {
734
735
735
736
736
737
/// A convenient way to seed new algorithmic generators with fresh entropy from
737
- /// `EntropyRng`.
738
+ /// [ `EntropyRng`] .
738
739
///
739
740
/// This is the recommended way to create PRNGs, unless a deterministic seed is
740
741
/// desired (in which case [`SeedableRng::from_seed`] should be used).
@@ -751,6 +752,7 @@ impl<R: RngCore> Iterator for AsciiGenerator<R> {
751
752
/// println!("Random die roll: {}", rng.gen_range(1, 7));
752
753
/// ```
753
754
///
755
+ /// [`EntropyRng`]: struct.EntropyRng.html
754
756
/// [`SeedableRng`]: https://docs.rs/rand_core/0.1/rand_core/trait.SeedableRng.html
755
757
/// [`SeedableRng::from_seed`]: https://docs.rs/rand_core/0.1/rand_core/trait.SeedableRng.html#tymethod.from_seed
756
758
#[ cfg( feature="std" ) ]
@@ -802,9 +804,10 @@ impl<R: SeedableRng> NewRng for R {
802
804
/// future library versions may use a different internal generator with
803
805
/// different output. Further, this generator may not be portable and can
804
806
/// produce different output depending on the architecture. If you require
805
- /// reproducible output, use a named RNG, for example `ChaChaRng`.
807
+ /// reproducible output, use a named RNG, for example [ `ChaChaRng`] .
806
808
///
807
809
/// [HC-128]: prng/hc128/struct.Hc128Rng.html
810
+ /// [`ChaChaRng`]: prng/chacha/struct.ChaChaRng.html
808
811
#[ derive( Clone , Debug ) ]
809
812
pub struct StdRng ( Hc128Rng ) ;
810
813
@@ -845,19 +848,19 @@ impl CryptoRng for StdRng {}
845
848
/// An RNG recommended when small state, cheap initialization and good
846
849
/// performance are required. The PRNG algorithm in `SmallRng` is chosen to be
847
850
/// efficient on the current platform, **without consideration for cryptography
848
- /// or security**. The size of its state is much smaller than for `StdRng`.
851
+ /// or security**. The size of its state is much smaller than for [ `StdRng`] .
849
852
///
850
853
/// Reproducibility of output from this generator is however not required, thus
851
854
/// future library versions may use a different internal generator with
852
855
/// different output. Further, this generator may not be portable and can
853
856
/// produce different output depending on the architecture. If you require
854
- /// reproducible output, use a named RNG, for example `XorShiftRng`.
857
+ /// reproducible output, use a named RNG, for example [ `XorShiftRng`] .
855
858
///
856
859
/// The current algorithm used on all platforms is [Xorshift].
857
860
///
858
861
/// # Examples
859
862
///
860
- /// Initializing `StdRng ` with a random seed can be done using `NewRng`:
863
+ /// Initializing `SmallRng ` with a random seed can be done using [ `NewRng`] :
861
864
///
862
865
/// ```
863
866
/// # use rand::Rng;
@@ -869,7 +872,7 @@ impl CryptoRng for StdRng {}
869
872
/// # let v: u32 = small_rng.gen();
870
873
/// ```
871
874
///
872
- /// When initializing a lot of `SmallRng`, using `thread_rng` can be more
875
+ /// When initializing a lot of `SmallRng`'s , using [ `thread_rng`] can be more
873
876
/// efficient:
874
877
///
875
878
/// ```
@@ -887,7 +890,11 @@ impl CryptoRng for StdRng {}
887
890
/// .collect();
888
891
/// ```
889
892
///
890
- /// [Xorshift]: struct.XorShiftRng.html
893
+ /// [`NewRng`]: trait.NewRng.html
894
+ /// [`StdRng`]: struct.StdRng.html
895
+ /// [`thread_rng`]: fn.thread_rng.html
896
+ /// [Xorshift]: prng/struct.XorShiftRng.html
897
+ /// [`XorShiftRng`]: prng/struct.XorShiftRng.html
891
898
#[ derive( Clone , Debug ) ]
892
899
pub struct SmallRng ( XorShiftRng ) ;
893
900
@@ -923,7 +930,7 @@ impl SeedableRng for SmallRng {
923
930
}
924
931
}
925
932
926
- /// DEPRECATED: use `SmallRng` instead.
933
+ /// DEPRECATED: use [ `SmallRng`] instead.
927
934
///
928
935
/// Create a weak random number generator with a default algorithm and seed.
929
936
///
@@ -933,6 +940,8 @@ impl SeedableRng for SmallRng {
933
940
/// create the `Rng` yourself.
934
941
///
935
942
/// This will seed the generator with randomness from `thread_rng`.
943
+ ///
944
+ /// [`SmallRng`]: struct.SmallRng.html
936
945
#[ deprecated( since="0.5.0" , note="removed in favor of SmallRng" ) ]
937
946
#[ cfg( feature="std" ) ]
938
947
pub fn weak_rng ( ) -> XorShiftRng {
0 commit comments