rust-lang / rust-lang/book

Mismatch type: Listing 17-5

Open
#4,471 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
18.3k
Forks
4.1k
Avg merge
14m
Merged PRs (30d)
1

Description

The listing 17-5 do not compile. Here is the compilation error message:

--> src\main.rs:19:13
|
19 | let (url, maybe_title) =
| ^^^^^^^^^^^^^^^^^^ expected Option<String>, found (_, _)
20 | / match trpl::race(title_fut_1, title_fut_2).await {
21 | | Either::Left(left) => left,
22 | | Either::Right(right) => right,
23 | | };
| |_____________- this expression has type Option<String>
|
= note: expected enum Option<String>
found tuple (_, _)

For more information about this error, try rustc --explain E0308.
error: could not compile ch17-1 (bin "ch17-1") due to 1 previous error

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Find listing 17-5 and compare it with src/main.rs around line 19; start by reproducing the reported compilation error for bin ch17-1. Update the listing to match the reported Option result from trpl::race, then verify that ch17-1 compiles.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.