rust-lang / rust-lang/rustlings
options2: unclear what to do and why
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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