-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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: Added exercises/enums #213
Conversation
Added 3 new exercises for enums, enums{1-3}.rs
Any reason this isnt being merged? |
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.
thanks! some minor nits
Banana, | ||
Apple, | ||
Pear, | ||
Mango |
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.
let's put a trailing comma here
|
||
fn main() { | ||
// Assign this variable to your favorite fruit | ||
// let fruit = ???; |
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.
shouldn't this say let favorite = ???
?
@@ -0,0 +1,61 @@ | |||
// enums3.rs | |||
// Try making an enum to immitate these structs |
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.
// Try making an enum to immitate these structs | |
// Try making an enum to imitate these structs |
|
||
fn main() { | ||
// These do not need to be touched :) but the file will not compile if the | ||
// elements of the enum have not been defines |
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.
// elements of the enum have not been defines | |
// elements of the enum have not been defined |
☔ The latest upstream changes (presumably #224) made this pull request unmergeable. Please resolve the merge conflicts. |
Closing this in favor of #224. |
Added 3 new exercises for enums,
enums{1-3}.rs
. Enums were used in some of the exercises but never taught. These 3 exercises cover putting elements into an enum, referencing elements in an enum, and a few of the types of elements you can have in an enum. All exercises closely follow the book and as such should be a good intro before the later lessons that use them.