Skip to content

Commit f8e5dcc

Browse files
committed
Mark non-runnable examples
1 parent 7019823 commit f8e5dcc

5 files changed

Lines changed: 9 additions & 8 deletions

File tree

src/guide-dist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Lets go over the distributions by type:
9393
support requires using the `simd_support` feature flag and nightly `rustc`.
9494
- For enums, you have to implement uniform sampling yourself. For example, you
9595
could use the following approach:
96-
```rust
96+
```rust,noplayground
9797
# use rand::{Rng, distr::{Distribution, StandardUniform}};
9898
pub enum Food {
9999
Burger,

src/guide-test-fn-rng.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn main() {
4343

4444
To test this, we can create a `MockCryptoRng` implementing `TryRngCore` and `TryCryptoRng` in our testing module. Note that `MockCryptoRng` is private and `#[cfg(test)] mod tests` is cfg-gated to our test environment, thus ensuring that `MockCryptoRng` cannot accidentally be used in production.
4545

46-
```rust
46+
```rust,noplayground
4747
#[cfg(test)]
4848
mod tests {
4949
use super::*;

src/update-0.5.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ A new trait has been added: `FromEntropy`. This is automatically implemented for
7474
any type supporting `SeedableRng`, and provides construction from fresh, strong
7575
entropy:
7676

77-
```rust
77+
```rust,noplayground
7878
use rand_0_5::{ChaChaRng, FromEntropy};
7979
8080
let mut rng = ChaChaRng::from_entropy();
@@ -120,7 +120,8 @@ use cannot be guaranteed.*
120120
A new `Error` type has been added, designed explicitly for no-std compatibility,
121121
simplicity, and enough flexibility for our uses (carrying a `cause` when
122122
possible):
123-
```ignore
123+
```rust,noplayground
124+
# use rand_0_5::ErrorKind;
124125
pub struct Error {
125126
pub kind: ErrorKind,
126127
pub msg: &'static str,
@@ -181,7 +182,7 @@ The method `ChaChaRng::set_counter` has been replaced by two new methods,
181182
`set_word_pos` and `set_stream`. Where necessary, the behaviour of the old
182183
method may be emulated as follows:
183184

184-
```rust
185+
```rust,noplayground
185186
# extern crate rand;
186187
# extern crate rand_chacha;
187188
# use rand::prelude::*;

src/update-0.7.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The [`FromEntropy`] trait has now been removed. Fear not though, its
2323
[`from_entropy`] method continues to provide easy initialisation from its new
2424
home in the [`SeedableRng`] trait (this requires that `rand_core` has the `std`
2525
or `getrandom` feature enabled):
26-
```rust
26+
```rust,noplayground
2727
# extern crate rand_0_7 as rand;
2828
use rand::{SeedableRng, rngs::StdRng};
2929
let mut rng = StdRng::from_entropy();

src/update-0.8.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ let a: u32 = Standard.sample_iter(rng).next().unwrap();
5252
let b: u32 = Standard.sample_iter(rng).next().unwrap();
5353
```
5454
can be replaced with the following code:
55-
```rust
55+
```rust,noplayground
5656
# extern crate rand;
5757
# use rand_0_8::prelude::*;
5858
# use rand_0_8::distributions::Standard;
@@ -130,7 +130,7 @@ Several smaller changes occurred to rand distributions:
130130
.collect();
131131
```
132132
With Rand 0.8, this is equivalent to the following:
133-
```rust
133+
```rust,noplayground
134134
# extern crate rand;
135135
# use rand_0_8::{distributions::Alphanumeric, Rng};
136136
# fn main() {

0 commit comments

Comments
 (0)