Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Option2 exercise #290

Merged
merged 5 commits into from
Apr 7, 2020
Merged

feat: Add Option2 exercise #290

merged 5 commits into from
Apr 7, 2020

Conversation

sanjaykdragon
Copy link
Contributor

I added another exercise for Option, as promised.
Let me know if there are any problems with this.
This one is specifically about if let / while let

@sanjaykdragon
Copy link
Contributor Author

@fmoko

Copy link
Member

@shadows-withal shadows-withal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I think this exercise could be structured in a different way. As I see it, you just need to wrap the variables in Some to pass right now, whereas I think a better approach would be to let the user write their own if let and while let statements. Also, you should add a couple of comments about which lines the user should try to edit to nudge them in the right direction.

@sanjaykdragon
Copy link
Contributor Author

Hmm, I think this exercise could be structured in a different way. As I see it, you just need to wrap the variables in Some to pass right now, whereas I think a better approach would be to let the user write their own if let and while let statements. Also, you should add a couple of comments about which lines the user should try to edit to nudge them in the right direction.

Alright, this is a better idea. I was thinking of doing that, but I felt that leaving the while let / if let sections blank would result in people just changing the entire code. Will change the style now

Copy link
Member

@shadows-withal shadows-withal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a few formatting nits and then we're good.

exercises/option/option2.rs Outdated Show resolved Hide resolved
exercises/option/option2.rs Show resolved Hide resolved
exercises/option/option2.rs Outdated Show resolved Hide resolved
exercises/option/option2.rs Show resolved Hide resolved
exercises/option/option2.rs Outdated Show resolved Hide resolved
sanjaykdragon and others added 3 commits April 7, 2020 13:48
Co-Authored-By: fmoko <mokou@posteo.net>
Co-Authored-By: fmoko <mokou@posteo.net>
Co-Authored-By: fmoko <mokou@posteo.net>
@sanjaykdragon
Copy link
Contributor Author

added your nits

@shadows-withal shadows-withal changed the title Option2 exercise feat: Add Option2 exercise Apr 7, 2020
@shadows-withal shadows-withal merged commit 86b5c08 into rust-lang:master Apr 7, 2020
@shadows-withal
Copy link
Member

Thanks!

pedantic79 pushed a commit to pedantic79/rustlings that referenced this pull request Apr 11, 2020
* added option2

* changed up the exercise, modified the help section

* Update exercises/option/option2.rs

Co-Authored-By: fmoko <mokou@posteo.net>

* Update exercises/option/option2.rs

Co-Authored-By: fmoko <mokou@posteo.net>

* Update exercises/option/option2.rs

Co-Authored-By: fmoko <mokou@posteo.net>

Co-authored-by: fmoko <mokou@posteo.net>
MendelMonteiro pushed a commit to MendelMonteiro/rustlings that referenced this pull request Jun 28, 2020
* added option2

* changed up the exercise, modified the help section

* Update exercises/option/option2.rs

Co-Authored-By: fmoko <mokou@posteo.net>

* Update exercises/option/option2.rs

Co-Authored-By: fmoko <mokou@posteo.net>

* Update exercises/option/option2.rs

Co-Authored-By: fmoko <mokou@posteo.net>

Co-authored-by: fmoko <mokou@posteo.net>
ppp3 pushed a commit to ppp3/rustlings that referenced this pull request May 23, 2022
* added option2

* changed up the exercise, modified the help section

* Update exercises/option/option2.rs

Co-Authored-By: fmoko <mokou@posteo.net>

* Update exercises/option/option2.rs

Co-Authored-By: fmoko <mokou@posteo.net>

* Update exercises/option/option2.rs

Co-Authored-By: fmoko <mokou@posteo.net>

Co-authored-by: fmoko <mokou@posteo.net>
dmoore04 pushed a commit to dmoore04/rustlings that referenced this pull request Sep 11, 2022
* added option2

* changed up the exercise, modified the help section

* Update exercises/option/option2.rs

Co-Authored-By: fmoko <mokou@posteo.net>

* Update exercises/option/option2.rs

Co-Authored-By: fmoko <mokou@posteo.net>

* Update exercises/option/option2.rs

Co-Authored-By: fmoko <mokou@posteo.net>

Co-authored-by: fmoko <mokou@posteo.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants