rust-lang / rust-lang/rust-by-example

? operator should be in the first, not last, sub-section of 18.4. Result

Open
#1,836 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Handlebars
Stars
8.1k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

Since the ? operator is in the last sub-section of 18.4. Result, all the other sub-sections and the main section are filled with code of the type:

let number = match number_str.parse::<i32>() {
    Ok(number)  => number,
    Err(e) => return Err(e),
};

This is really confusing. Especially for someone who is reading the sections in order because in 18.3. Option & unwrap, the ? operator is in the first sub-section. You are telling the reader what the good way of doing something is but then giving him 4 sections of code written in what you just described as the worse way of doing it...

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

Start by locating the chapter 18.4 Result content and compare its subsection order with 18.3 Option & unwrap. Review the examples as they appear in sequence, then confirm that the ? operator is introduced in the intended position and that the surrounding examples remain consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.