diff --git a/README.md b/README.md index bcda7d38..14756f82 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ If you'd like to read it locally: ```bash $ git clone https://github.com/rust-lang-nursery/rust-cookbook $ cd rust-cookbook -$ cargo install mdbook --vers "0.1.7" +$ cargo install mdbook --vers "0.1.8" $ mdbook serve --open ``` diff --git a/ci/deploy.sh b/ci/deploy.sh index 36895e62..60e70eb3 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -63,10 +63,6 @@ echo "Committing book directory to gh-pages branch" REV=$(git rev-parse --short HEAD) cd book -# hotfix for https://github.com/rust-lang-nursery/rust-cookbook/issues/416 -sed -i -e "s/_FontAwesome/FontAwesome/" *.html -mv ./_FontAwesome ./FontAwesome - git init git remote add upstream "https://$GH_TOKEN@github.com/rust-lang-nursery/rust-cookbook.git" git config user.name "Rust Cookbook" diff --git a/ci/install_deps.sh b/ci/install_deps.sh index 736b77bb..7e5c59c7 100755 --- a/ci/install_deps.sh +++ b/ci/install_deps.sh @@ -16,8 +16,7 @@ if [[ "${CONTENT_TESTS:-}" == 1 ]]; then pyenv global system 3.6 pip3 install --user link-checker==0.1.0 fi - cargo install mdbook --vers '0.1.7' --debug + cargo install mdbook --vers '0.1.8' --debug fi exit 0 - diff --git a/src/basics.md b/src/basics.md index 770e5008..f835084e 100644 --- a/src/basics.md +++ b/src/basics.md @@ -187,18 +187,18 @@ fn main() { } ``` -Alternatively, one can use [`Range`] to obtain values with [uniform distribution]. +Alternatively, one can use [`Uniform`] to obtain values with [uniform distribution]. This has the same effect, but may be faster when repeatedly generating numbers in the same range. ```rust extern crate rand; -use rand::distributions::{Range, Distribution}; +use rand::distributions::{Uniform, Distribution}; fn main() { let mut rng = rand::thread_rng(); - let die = Range::new(1, 7); + let die = Uniform::new(1, 7); loop { let throw = die.sample(&mut rng); @@ -1839,7 +1839,7 @@ fn run() -> Result<()> { [`process::Stdio`]: https://doc.rust-lang.org/std/process/struct.Stdio.html [`rand::Rng`]: https://docs.rs/rand/*/rand/trait.Rng.html [`rand::thread_rng`]: https://docs.rs/rand/*/rand/fn.thread_rng.html -[`Range`]: https://docs.rs/rand/*/rand/distributions/#reexports +[`Uniform`]: https://docs.rs/rand/*/rand/distributions/uniform/struct.Uniform.html [`Standard`]: https://docs.rs/rand/*/rand/distributions/struct.Standard.html [`Distribution`]: https://docs.rs/rand/*/rand/distributions/trait.Distribution.html [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html