Skip to content

Commit

Permalink
Improve readability of Multi-threaded Link Checker. (#1941)
Browse files Browse the repository at this point in the history
  • Loading branch information
raffomartini authored Mar 25, 2024
1 parent c3a5fed commit f2601d1
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions src/exercises/concurrency/link-checker.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,23 @@ start at a webpage and check that links on the page are valid. It should
recursively check other pages on the same domain and keep doing this until all
pages have been validated.

For this, you will need an HTTP client such as [`reqwest`][1]. Create a new
Cargo project and `reqwest` it as a dependency with:
For this, you will need an HTTP client such as [`reqwest`][1]. You will also
need a way to find links, we can use [`scraper`][2]. Finally, we'll need some
way of handling errors, we will use [`thiserror`][3].

Create a new Cargo project and `reqwest` it as a dependency with:

```shell
cargo new link-checker
cd link-checker
cargo add --features blocking,rustls-tls reqwest
cargo add scraper
cargo add thiserror
```

> If `cargo add` fails with `error: no such subcommand`, then please edit the
> `Cargo.toml` file by hand. Add the dependencies listed below.
You will also need a way to find links. We can use [`scraper`][2] for that:

```shell
cargo add scraper
```

Finally, we'll need some way of handling errors. We use [`thiserror`][3] for
that:

```shell
cargo add thiserror
```

The `cargo add` calls will update the `Cargo.toml` file to look like this:

<!-- File Cargo.toml -->
Expand Down

0 comments on commit f2601d1

Please sign in to comment.