-
Notifications
You must be signed in to change notification settings - Fork 10k
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
enums3.rs Comment confusing for new users. #1706
Comments
After having re-read, it appears that enums3.rs expects you to create a message like this, but that change was then later reversed or never applied: enum Message {
ChangeColor((u8, u8, u8)),
...
} However, it is never indicated in the usage that this is the desired use. Maybe something like this should be added to the use case: let color = (255, 0, 255);
state.process(Message::ChangeColor(color)); Putting the variable on a separate line makes it clear that the double parentheses added in the above commit are intentional. |
Fixed in 708cfef by avoiding this confusion with double parentheses. |
The comment in the enums3.rs exercise:
Was very confusing to me, when I was doing the exercise. It made me second guess my attempt (which turned out to be correct), because it made me think that I needed to have extra parentheses in this line:
After asking in Discord, I now understand that it was intended to remind me of the need for extra parentheses in a function signature, for future reference, but as it wasn't actually applicable at all in the exercise, I found myself searching for a place that I needed to place those extra parentheses.
The text was updated successfully, but these errors were encountered: