chore: fixed merge conflicts from traits exercises added by s-marios
I hope this doesn't step on any toes but I wanted to try the traits exercises from #216 so I updated them to match the new structure with hints included in info.toml
After being stuck on exercise enums3.rs for about an hour or two, having read the entire chapter on enums 2-3 times, and still being unable to complete the exercise, i started broadening my reading. I finally found the answer in the rust docs via google.
Hints are now accessible using the CLI subcommand `rustlings hint
<exercise name`.
BREAKING CHANGE: This fundamentally changes the way people interact with exercises.
feat: Add enums exercises
Creates an exhaustive list of enum exercises. This goes through the basics of different ways to derive enums with mixed data type variants, as well as the use of the all important `match` operator.
closes#194
The author of issue #194 suggests that the wording of the comment is at
least ambiguous about the desired results. I believe this change more
clearly describes the expectation of the exercise.
This commit converts primitive_types4 to a test and asserts that the
slice given is equal to the expected slice.
The intent of the primitive_types4 exercise appears to be to ensure the
user understands inclusive and exclusive bounds as well as slice syntax.
`rustlings` commands using `compile` do not verify that a specific
println is reached and, in the case of `watch` and `verify` (but not
`run`), they do not output the `println`s at all.
This fix is semantically similar to #198. It does not take a stance on
the correct way to handle this for all exercises; see #127. There are
likely other exercises whose intent are masked by this issue.
`Expected` should come before `actual`, other wise it leads to confusing compiler messages, e.g.
```
note: expected type `()`
found type `{integer}`
```
chore: Fix a couple broken book links
While I was fixing these, I figured maybe it's good to just use a consistent URL for book links: https://doc.rust-lang.org/book/
Is there a plan for what to do with this old 1.4.0 example that doesn't exist in the current version of the book? Perhaps at least include a disclaimer when recommending that folks check it out?
34e31232df/exercises/threads/README.md (L1)
chore: Clean up some formatting in exercises
I noticed some formatting that isn't consistent with the `rustfmt` style and tried my best to run it on the files in the exercises directory (which does fail for files that can't compile!), which just caught some minor whitespace things here and there.
Note: also can't just apply `rustfmt` blindly because of the blank lines that lead to the hint comments
Fixes the irrefutable let pattern warning in `structs1.rs`
PR https://github.com/rust-lang/rustlings/pull/163 accidentally introduced an error using some versions of the Rust compiler where the compiler would (rightly!) complain about an irrefutable let pattern. I have no idea why this did not occur in all versions of the compiler, but here is a way around it.
Sub READMEs contain the relevant resources from the main
README of the web version. All second edition Rust Book links
were updated to the 2018 edition.
Fixed to typos in main README.md.