Skip to content

Commit 6290e99

Browse files
authored
Merge pull request #423 from pitdicker/documentation
Documentation
2 parents 63bde31 + 4346828 commit 6290e99

21 files changed

+569
-211
lines changed

rand_core/src/impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ macro_rules! fill_via_chunks {
119119
/// # Example
120120
/// (from `IsaacRng`)
121121
///
122-
/// ```rust,ignore
122+
/// ```ignore
123123
/// fn fill_bytes(&mut self, dest: &mut [u8]) {
124124
/// let mut read_len = 0;
125125
/// while read_len < dest.len() {

rand_core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub mod le;
109109
///
110110
/// A simple example, obviously not generating very *random* output:
111111
///
112-
/// ```rust
112+
/// ```
113113
/// #![allow(dead_code)]
114114
/// use rand_core::{RngCore, Error, impls};
115115
///

src/distributions/binomial.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use std::f64::consts::PI;
2222
///
2323
/// # Example
2424
///
25-
/// ```rust
25+
/// ```
2626
/// use rand::distributions::{Binomial, Distribution};
2727
///
2828
/// let bin = Binomial::new(20, 0.3);

src/distributions/exponential.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use distributions::{ziggurat, ziggurat_tables, Distribution};
2929
/// College, Oxford
3030
///
3131
/// # Example
32-
/// ```rust
32+
/// ```
3333
/// use rand::prelude::*;
3434
/// use rand::distributions::Exp1;
3535
///
@@ -66,7 +66,7 @@ impl Distribution<f64> for Exp1 {
6666
///
6767
/// # Example
6868
///
69-
/// ```rust
69+
/// ```
7070
/// use rand::distributions::{Exp, Distribution};
7171
///
7272
/// let exp = Exp::new(2.0);

src/distributions/float.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use distributions::{Distribution, Standard};
2727
/// ranges.
2828
///
2929
/// # Example
30-
/// ```rust
30+
/// ```
3131
/// use rand::{thread_rng, Rng};
3232
/// use rand::distributions::OpenClosed01;
3333
///
@@ -53,7 +53,7 @@ pub struct OpenClosed01;
5353
/// ranges.
5454
///
5555
/// # Example
56-
/// ```rust
56+
/// ```
5757
/// use rand::{thread_rng, Rng};
5858
/// use rand::distributions::Open01;
5959
///

src/distributions/gamma.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use distributions::{Distribution, Exp, Open01};
3535
///
3636
/// # Example
3737
///
38-
/// ```rust
38+
/// ```
3939
/// use rand::distributions::{Distribution, Gamma};
4040
///
4141
/// let gamma = Gamma::new(2.0, 5.0);
@@ -178,7 +178,7 @@ impl Distribution<f64> for GammaLargeShape {
178178
///
179179
/// # Example
180180
///
181-
/// ```rust
181+
/// ```
182182
/// use rand::distributions::{ChiSquared, Distribution};
183183
///
184184
/// let chi = ChiSquared::new(11.0);
@@ -233,7 +233,7 @@ impl Distribution<f64> for ChiSquared {
233233
///
234234
/// # Example
235235
///
236-
/// ```rust
236+
/// ```
237237
/// use rand::distributions::{FisherF, Distribution};
238238
///
239239
/// let f = FisherF::new(2.0, 32.0);
@@ -274,7 +274,7 @@ impl Distribution<f64> for FisherF {
274274
///
275275
/// # Example
276276
///
277-
/// ```rust
277+
/// ```
278278
/// use rand::distributions::{StudentT, Distribution};
279279
///
280280
/// let t = StudentT::new(11.0);

src/distributions/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
//! - [`Normal`] distribution, and [`StandardNormal`] as a primitive
8484
//! - Related to Bernoulli trials (yes/no events, with a given probability):
8585
//! - [`Binomial`] distribution
86+
//! - [`Bernoulli`] distribution, similar to [`Rng::gen_bool`].
8687
//! - Related to positive real-valued quantities that grow exponentially
8788
//! (e.g. prices, incomes, populations):
8889
//! - [`LogNormal`] distribution
@@ -145,6 +146,7 @@
145146
//! [Floating point implementation]: struct.Standard.html#floating-point-implementation
146147
// distributions
147148
//! [`Alphanumeric`]: struct.Alphanumeric.html
149+
//! [`Bernoulli`]: struct.Bernoulli.html
148150
//! [`Binomial`]: struct.Binomial.html
149151
//! [`ChiSquared`]: struct.ChiSquared.html
150152
//! [`Exp`]: struct.Exp.html

src/distributions/normal.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use distributions::{ziggurat, ziggurat_tables, Distribution, Open01};
2727
/// College, Oxford
2828
///
2929
/// # Example
30-
/// ```rust
30+
/// ```
3131
/// use rand::prelude::*;
3232
/// use rand::distributions::StandardNormal;
3333
///
@@ -79,7 +79,7 @@ impl Distribution<f64> for StandardNormal {
7979
///
8080
/// # Example
8181
///
82-
/// ```rust
82+
/// ```
8383
/// use rand::distributions::{Normal, Distribution};
8484
///
8585
/// // mean 2, standard deviation 3
@@ -124,7 +124,7 @@ impl Distribution<f64> for Normal {
124124
///
125125
/// # Example
126126
///
127-
/// ```rust
127+
/// ```
128128
/// use rand::distributions::{LogNormal, Distribution};
129129
///
130130
/// // mean 2, standard deviation 3

src/distributions/other.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use distributions::{Distribution, Standard, Uniform};
2323
///
2424
/// # Example
2525
///
26-
/// ```rust
26+
/// ```
2727
/// use std::iter;
2828
/// use rand::{Rng, thread_rng};
2929
/// use rand::distributions::Alphanumeric;

src/distributions/poisson.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use std::f64::consts::PI;
2222
///
2323
/// # Example
2424
///
25-
/// ```rust
25+
/// ```
2626
/// use rand::distributions::{Poisson, Distribution};
2727
///
2828
/// let poi = Poisson::new(2.0);

0 commit comments

Comments
 (0)