Skip to content

Commit

Permalink
Merge pull request #423 from pitdicker/documentation
Browse files Browse the repository at this point in the history
Documentation
  • Loading branch information
dhardy authored May 15, 2018
2 parents 63bde31 + 4346828 commit 6290e99
Show file tree
Hide file tree
Showing 21 changed files with 569 additions and 211 deletions.
2 changes: 1 addition & 1 deletion rand_core/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ macro_rules! fill_via_chunks {
/// # Example
/// (from `IsaacRng`)
///
/// ```rust,ignore
/// ```ignore
/// fn fill_bytes(&mut self, dest: &mut [u8]) {
/// let mut read_len = 0;
/// while read_len < dest.len() {
Expand Down
2 changes: 1 addition & 1 deletion rand_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub mod le;
///
/// A simple example, obviously not generating very *random* output:
///
/// ```rust
/// ```
/// #![allow(dead_code)]
/// use rand_core::{RngCore, Error, impls};
///
Expand Down
2 changes: 1 addition & 1 deletion src/distributions/binomial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::f64::consts::PI;
///
/// # Example
///
/// ```rust
/// ```
/// use rand::distributions::{Binomial, Distribution};
///
/// let bin = Binomial::new(20, 0.3);
Expand Down
4 changes: 2 additions & 2 deletions src/distributions/exponential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use distributions::{ziggurat, ziggurat_tables, Distribution};
/// College, Oxford
///
/// # Example
/// ```rust
/// ```
/// use rand::prelude::*;
/// use rand::distributions::Exp1;
///
Expand Down Expand Up @@ -66,7 +66,7 @@ impl Distribution<f64> for Exp1 {
///
/// # Example
///
/// ```rust
/// ```
/// use rand::distributions::{Exp, Distribution};
///
/// let exp = Exp::new(2.0);
Expand Down
4 changes: 2 additions & 2 deletions src/distributions/float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use distributions::{Distribution, Standard};
/// ranges.
///
/// # Example
/// ```rust
/// ```
/// use rand::{thread_rng, Rng};
/// use rand::distributions::OpenClosed01;
///
Expand All @@ -53,7 +53,7 @@ pub struct OpenClosed01;
/// ranges.
///
/// # Example
/// ```rust
/// ```
/// use rand::{thread_rng, Rng};
/// use rand::distributions::Open01;
///
Expand Down
8 changes: 4 additions & 4 deletions src/distributions/gamma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use distributions::{Distribution, Exp, Open01};
///
/// # Example
///
/// ```rust
/// ```
/// use rand::distributions::{Distribution, Gamma};
///
/// let gamma = Gamma::new(2.0, 5.0);
Expand Down Expand Up @@ -178,7 +178,7 @@ impl Distribution<f64> for GammaLargeShape {
///
/// # Example
///
/// ```rust
/// ```
/// use rand::distributions::{ChiSquared, Distribution};
///
/// let chi = ChiSquared::new(11.0);
Expand Down Expand Up @@ -233,7 +233,7 @@ impl Distribution<f64> for ChiSquared {
///
/// # Example
///
/// ```rust
/// ```
/// use rand::distributions::{FisherF, Distribution};
///
/// let f = FisherF::new(2.0, 32.0);
Expand Down Expand Up @@ -274,7 +274,7 @@ impl Distribution<f64> for FisherF {
///
/// # Example
///
/// ```rust
/// ```
/// use rand::distributions::{StudentT, Distribution};
///
/// let t = StudentT::new(11.0);
Expand Down
2 changes: 2 additions & 0 deletions src/distributions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
//! - [`Normal`] distribution, and [`StandardNormal`] as a primitive
//! - Related to Bernoulli trials (yes/no events, with a given probability):
//! - [`Binomial`] distribution
//! - [`Bernoulli`] distribution, similar to [`Rng::gen_bool`].
//! - Related to positive real-valued quantities that grow exponentially
//! (e.g. prices, incomes, populations):
//! - [`LogNormal`] distribution
Expand Down Expand Up @@ -145,6 +146,7 @@
//! [Floating point implementation]: struct.Standard.html#floating-point-implementation
// distributions
//! [`Alphanumeric`]: struct.Alphanumeric.html
//! [`Bernoulli`]: struct.Bernoulli.html
//! [`Binomial`]: struct.Binomial.html
//! [`ChiSquared`]: struct.ChiSquared.html
//! [`Exp`]: struct.Exp.html
Expand Down
6 changes: 3 additions & 3 deletions src/distributions/normal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use distributions::{ziggurat, ziggurat_tables, Distribution, Open01};
/// College, Oxford
///
/// # Example
/// ```rust
/// ```
/// use rand::prelude::*;
/// use rand::distributions::StandardNormal;
///
Expand Down Expand Up @@ -79,7 +79,7 @@ impl Distribution<f64> for StandardNormal {
///
/// # Example
///
/// ```rust
/// ```
/// use rand::distributions::{Normal, Distribution};
///
/// // mean 2, standard deviation 3
Expand Down Expand Up @@ -124,7 +124,7 @@ impl Distribution<f64> for Normal {
///
/// # Example
///
/// ```rust
/// ```
/// use rand::distributions::{LogNormal, Distribution};
///
/// // mean 2, standard deviation 3
Expand Down
2 changes: 1 addition & 1 deletion src/distributions/other.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use distributions::{Distribution, Standard, Uniform};
///
/// # Example
///
/// ```rust
/// ```
/// use std::iter;
/// use rand::{Rng, thread_rng};
/// use rand::distributions::Alphanumeric;
Expand Down
2 changes: 1 addition & 1 deletion src/distributions/poisson.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::f64::consts::PI;
///
/// # Example
///
/// ```rust
/// ```
/// use rand::distributions::{Poisson, Distribution};
///
/// let poi = Poisson::new(2.0);
Expand Down
Loading

0 comments on commit 6290e99

Please sign in to comment.