Skip to content

Commit a96faa5

Browse files
committed
edition
1 parent 3e8af42 commit a96faa5

File tree

10 files changed

+14
-20
lines changed

10 files changed

+14
-20
lines changed

src/concurrency.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,26 @@
77
| [Pass data between two threads][ex-crossbeam-spsc] | [![crossbeam-badge]][crossbeam] | [![cat-concurrency-badge]][cat-concurrency] |
88
| [Maintain global mutable state][ex-global-mut-state] | [![lazy_static-badge]][lazy_static] | [![cat-rust-patterns-badge]][cat-rust-patterns] |
99
| [Calculate SHA1 sum of *.iso files concurrently][ex-threadpool-walk] | [![threadpool-badge]][threadpool] [![walkdir-badge]][walkdir] [![num_cpus-badge]][num_cpus] [![ring-badge]][ring] | [![cat-concurrency-badge]][cat-concurrency][![cat-filesystem-badge]][cat-filesystem] |
10+
| [Draw fractal dispatching work to a thread pool][ex-threadpool-fractal] | [![threadpool-badge]][threadpool] [![num-badge]][num] [![num_cpus-badge]][num_cpus] [![image-badge]][image] | [![cat-concurrency-badge]][cat-concurrency][![cat-science-badge]][cat-science][![cat-rendering-badge]][cat-rendering] |
1011
| [Mutate the elements of an array in parallel][ex-rayon-iter-mut] | [![rayon-badge]][rayon] | [![cat-concurrency-badge]][cat-concurrency] |
1112
| [Test in parallel if any or all elements of a collection match a given predicate][ex-rayon-any-all] | [![rayon-badge]][rayon] | [![cat-concurrency-badge]][cat-concurrency] |
1213
| [Search items using given predicate in parallel][ex-rayon-parallel-search] | [![rayon-badge]][rayon] | [![cat-concurrency-badge]][cat-concurrency] |
1314
| [Sort a vector in parallel][ex-rayon-parallel-sort] | [![rayon-badge]][rayon] [![rand-badge]][rand] | [![cat-concurrency-badge]][cat-concurrency] |
1415
| [Map-reduce in parallel][ex-rayon-map-reduce] | [![rayon-badge]][rayon] | [![cat-concurrency-badge]][cat-concurrency] |
16+
| [Generate jpg thumbnails in parallel][ex-rayon-thumbnails] | [![rayon-badge]][rayon] [![glob-badge]][glob] [![image-badge]][image] | [![cat-concurrency-badge]][cat-concurrency][![cat-filesystem-badge]][cat-filesystem] |
1517

1618

1719
[ex-crossbeam-spawn]: concurrency/threads.html#spawn-a-short-lived-thread
1820
[ex-crossbeam-pipeline]: concurrency/threads.html#create-a-parallel-pipeline
1921
[ex-crossbeam-spsc]: concurrency/threads.html#pass-data-between-two-threads
2022
[ex-global-mut-state]: concurrency/threads.html#maintain-global-mutable-state
2123
[ex-threadpool-walk]: concurrency/threads.html#calculate-sha256-sum-of-iso-files-concurrently
24+
[ex-threadpool-fractal]: concurrency/threads.html#draw-fractal-dispatching-work-to-a-thread-pool
2225
[ex-rayon-iter-mut]: concurrency/parallel.html#mutate-the-elements-of-an-array-in-parallel
2326
[ex-rayon-any-all]: concurrency/parallel.html#test-in-parallel-if-any-or-all-elements-of-a-collection-match-a-given-predicate
2427
[ex-rayon-parallel-search]: concurrency/parallel.html#search-items-using-given-predicate-in-parallel
2528
[ex-rayon-parallel-sort]: concurrency/parallel.html#sort-a-vector-in-parallel
2629
[ex-rayon-map-reduce]: concurrency/parallel.html#map-reduce-in-parallel
30+
[ex-rayon-thumbnails]: concurrency/parallel.html#generate-jpg-thumbnails-in-parallel
2731

2832
{{#include links.md}}

src/database/sqlite/initialization.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ Use the `rusqlite` crate to open SQLite databases. See
77

88
[`Connection::open`] will create the database if it doesn't already exist.
99

10-
```rust,edition2024,no_run
11-
extern crate rusqlite;
10+
```rust,edition2021,no_run
1211
use rusqlite::{Connection, Result};
1312
1413
fn main() -> Result<()> {

src/database/sqlite/insert_select.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
[`Connection::open`] will open the database `cats` created in the earlier recipe.
66
This recipe inserts data into `cat_colors` and `cats` tables using the [`execute`] method of `Connection`. First, the data is inserted into the `cat_colors` table. After a record for a color is inserted, [`last_insert_rowid`] method of `Connection` is used to get `id` of the last color inserted. This `id` is used while inserting data into the `cats` table. Then, the select query is prepared using the [`prepare`] method which gives a [`statement`] struct. Then, query is executed using [`query_map`] method of [`statement`].
77

8-
```rust,edition2024,no_run
9-
extern crate rusqlite;
8+
```rust,edition2021,no_run
109
use rusqlite::{params, Connection, Result};
1110
use std::collections::HashMap;
1211

src/database/sqlite/transactions.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ a unique constraint on the color name. When an attempt to insert
1212
a duplicate color is made, the transaction rolls back.
1313

1414

15-
```rust,edition2024,no_run
16-
extern crate rusqlite;
15+
```rust,edition2021,no_run
1716
use rusqlite::{Connection, Result};
1817
1918
fn main() -> Result<()> {

src/file/read/read_lines.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
```rust,edition2018
2-
extern crate tempfile;
1+
```rust,edition2021
2+
33
use std::fs::File;
44
use std::io::{self, BufRead, BufReader, Write};
55
use tempfile::NamedTempFile;

src/hardware/processor/cpu-count.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
Shows the number of logical CPU cores in current machine using [`num_cpus::get`].
66

7-
```rust,edition2018
8-
extern crate num_cpus;
7+
```rust,edition2021
98
fn main() {
109
println!("Number of logical cores is {}", num_cpus::get());
1110
}

src/web/clients/api/paginated.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Wraps a paginated web API in a convenient Rust iterator. The iterator lazily
66
fetches the next page of results from the remote server as it arrives at the end of each page.
77

8-
```rust,edition2024,no_run
8+
```rust,edition2021,no_run
99
// cargo-deps: reqwest="0.11", serde="1"
1010
mod paginated {
1111
use reqwest::Result;

src/web/mime/request.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ The [`mime`] crate also defines some commonly used MIME types.
1111

1212
Note that the [`reqwest::header`] module is exported from the [`http`] crate.
1313

14-
```rust,edition2018,no_run
15-
extern crate mime;
16-
extern crate reqwest;
17-
extern crate anyhow;
18-
extern crate tokio;
14+
```rust,edition2021,no_run
1915
use anyhow::Result;
2016
use mime::Mime;
2117
use std::str::FromStr;

src/web/scraping/unique.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ MediaWiki link syntax is described [here][MediaWiki link syntax]. The calling
1010
function will retain the whole document, and links will be returned as slice
1111
references to the original document.
1212

13-
```rust,edition2024,no_run
13+
```rust,edition2021,no_run
1414
// cargo-deps: tokio="1", reqwest="0.11", regex="1", anyhow="1"
1515
mod wiki {
1616
use regex::Regex;

src/web/url/base.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ files or query strings. Each of those items are stripped out of the given
77
URL. [`PathSegmentsMut::clear`] removes paths and [`Url::set_query`] removes
88
query string.
99

10-
```rust,edition2018
11-
extern crate url;
12-
extern crate anyhow;
10+
```rust,edition2021
1311
use anyhow::{Result, anyhow};
1412
use url::Url;
1513

0 commit comments

Comments
 (0)