Skip to content

Commit c735f0a

Browse files
committed
update syntax
1 parent fdcc151 commit c735f0a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+12
-148
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ cc = "1.0"
2121
chrono = "0.4"
2222
clap = "4.5"
2323
crossbeam = "0.8"
24-
crossbeam-channel = "0.3.9"
24+
crossbeam-channel = "0.5"
2525
csv = "1.0"
2626
data-encoding = "2.1.0"
2727
env_logger = "0.11.3"

src/about.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ Consider this example for "generate random numbers within a range":
5757
[![rand-badge]][rand] [![cat-science-badge]][cat-science]
5858

5959
```rust,edition2018
60-
extern crate rand;
6160
use rand::Rng;
6261
6362
fn main() {

src/algorithms/randomness/rand-choose.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
Randomly generates a string of given length ASCII characters with custom
66
user-defined bytestring, with [`gen_range`].
77

8-
```rust,edition2018
9-
extern crate rand;
8+
```rust,edition2018,ignore
109
use rand::Rng;
1110
1211
const CHARSET: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZ\
@@ -20,7 +19,7 @@ fn main() {
2019
let password: String = (0..PASSWORD_LEN)
2120
.map(|_| {
2221
let idx = rng.gen_range(0..CHARSET.len());
23-
CHARSET[idx] as char
22+
char::from(CHARSET[idx])
2423
})
2524
.collect();
2625

src/algorithms/randomness/rand-custom.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
Randomly generates a tuple `(i32, bool, f64)` and variable of user defined type `Point`.
66
Implements the [`Distribution`] trait on type Point for [`Standard`] in order to allow random generation.
77

8-
```rust,edition2018,ignore,no_run
9-
extern crate rand;
8+
```rust,edition2018,no_run
109
use rand::Rng;
1110
use rand::distributions::{Distribution, Standard};
1211

src/algorithms/randomness/rand-dist.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@ The [distributions available are documented here][rand-distributions].
1313
An example using the [`Normal`] distribution is shown below.
1414

1515
```rust,edition2018,ignore
16-
extern crate rand;
17-
extern crate rand_distr;
1816
use rand::Rng;
1917
use rand_distr::{Distribution, LogNormal, Normal};
20-
use rand::distributions::Distribution as RandDistribution;
2118
2219
fn main() {
2320
let mut rng = rand::thread_rng();

src/algorithms/randomness/rand-passwd.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
Randomly generates a string of given length ASCII characters in the range `A-Z,
66
a-z, 0-9`, with [`Alphanumeric`] sample.
77

8-
```rust,edition2018,ignore,no_run
9-
extern crate rand;
8+
```rust,edition2018,no_run
109
use rand::{thread_rng, Rng};
1110
use rand::distributions::Alphanumeric;
1211

src/algorithms/randomness/rand-range.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
Generates a random value within half-open `[0, 10)` range (not including `10`) with [`Rng::gen_range`].
66

77
```rust,edition2018,ignore
8-
extern crate rand;
98
use rand::Rng;
109
1110
fn main() {
@@ -20,8 +19,6 @@ This has the same effect, but may be faster when repeatedly generating numbers
2019
in the same range.
2120

2221
```rust,edition2018,ignore
23-
extern crate rand;
24-
extern crate rand_distr;
2522
use rand::Rng;
2623
use rand_distr::{Distribution, Uniform};
2724

src/algorithms/randomness/rand.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ initialized generator. Integers are uniformly distributed over the range of the
88
type, and floating point numbers are uniformly distributed from 0 up to but not
99
including 1.
1010

11-
```rust,edition2018
12-
extern crate rand;
11+
```rust,edition2018,ignore
1312
use rand::Rng;
1413
1514
fn main() {

src/cli/ansi_terminal/ansi_term-basic.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ There are two main data structures in [`ansi_term`]: [`ANSIString`] and [`Style`
1111
### Printing colored text to the Terminal
1212

1313
```rust,edition2018
14-
extern crate ansi_term;
1514
use ansi_term::Colour;
1615
1716
fn main() {
@@ -29,7 +28,6 @@ needs to construct `Style` struct. [`Style::new()`] creates the struct,
2928
and properties chained.
3029

3130
```rust,edition2018
32-
extern crate ansi_term;
3331
use ansi_term::Style;
3432
3533
fn main() {
@@ -42,7 +40,6 @@ fn main() {
4240
`Colour` implements many similar functions as `Style` and can chain methods.
4341

4442
```rust,edition2018
45-
extern crate ansi_term;
4643
use ansi_term::Colour;
4744
use ansi_term::Style;
4845

src/cli/arguments/clap-basic.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ practice, but when it happens it is really frustrating
2323
without this.
2424

2525
```rust,edition2018
26-
extern crate clap;
2726
use std::path::PathBuf;
2827
2928
use clap::{Arg, Command, builder::PathBufValueParser};

0 commit comments

Comments
 (0)