rust-lang / rust-lang/rustlings

options2: unclear what to do and why

Open
#1,990 5 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-exercises C-enhancement P-low
Dominant language
Rust
Stars
64.2k
Forks
11.3k
Avg merge
5h 24m
Merged PRs (30d)
2

Description

Hello Rustlings Team,

First of all thank you for this project. It was really fun solving it so far. I got really stuck and scratching my head at this one and I decided to ask you for an improvement.

    fn simple_option() {
        let target = "rustlings";
        let optional_target = Some(target);

        // TODO: Make this an if let statement whose value is "Some" type
        word = optional_target {
            assert_eq!(word, target);
        }
    }

Looks like this excercise is trying to show how to use Option<T> type in Rust. Currently, the exercise seems somewhat forced and does not effectively demonstrate the real-world use cases of the Option type.

We start with a "rustlings" string literal and wrap it in optional_target. Then the comment asks us to Make this an if let statement whose value is "Some" type (which is a riddle by itself) providing us with some convoluted assertion. I am just learning Rust and have never seen this type before. If that task had some real-world scenario showing us why Option type is useful (for example safe parsing of data) that would really help.

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 reviewing the options2 exercise and its current instruction and example. Clarify what the exercise should teach about Option, then define a concrete, beginner-understandable task and acceptance criteria; the issue does not name a file or test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
content
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.