-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Conversation
@fmoko |
There was a problem hiding this 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.
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 |
There was a problem hiding this 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.
Co-Authored-By: fmoko <mokou@posteo.net>
Co-Authored-By: fmoko <mokou@posteo.net>
Co-Authored-By: fmoko <mokou@posteo.net>
added your nits |
Thanks! |
* 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>
* 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>
* 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>
* 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>
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