-
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
Refactor hints #231
Refactor hints #231
Conversation
BREAKING CHANGE: This changes the way you use `rustlings run` by now requiring an abridged form of the previous filename, e.g: `rustlings run exercises/if/if1.rs` becomes `rustlings run if1`
Hints are now accessible using the CLI subcommand `rustlings hint <exercise name`. BREAKING CHANGE: This fundamentally changes the way people interact with exercises.
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit 795b6e3 has been approved by |
@bors r- |
Also closes #203. |
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.
A few comments
|
||
let exercise = exercises.iter().find(matching_exercise).unwrap_or_else(|| { | ||
println!("No exercise found for your file name!"); | ||
println!("No exercise found for your given name!"); |
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.
Now that we rely on exercise names, I wonder whether there should be a test to check that exercise names are unique.
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.
Probably, but it'd be out of scope for this PR
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.
LGTM
@bors r+ |
📌 Commit 1a7bb5a has been approved by |
@bors r- |
⌛ Testing commit 1a7bb5a with merge fdf6a13b66c9bd3fe067969600f9b5d0a74169f3... |
@bors r=jrvidal |
📌 Commit 1a7bb5a has been approved by |
Refactor hints Breaking change. This removes hints from the end of files, and puts them into `info.toml`. You can now access hints using: ``` rustlings hint <exerciseName> ``` ALSO this changes the exercise system to index by name for `run` and `hint`, so: ``` rustlings run exercises/if/if1.rs ``` becomes ``` rustlings run if1 ```
☀️ Test successful - checks-travis |
Refactor hints Breaking change. This removes hints from the end of files, and puts them into `info.toml`. You can now access hints using: ``` rustlings hint <exerciseName> ``` ALSO this changes the exercise system to index by name for `run` and `hint`, so: ``` rustlings run exercises/if/if1.rs ``` becomes ``` rustlings run if1 ```
Refactor hints Breaking change. This removes hints from the end of files, and puts them into `info.toml`. You can now access hints using: ``` rustlings hint <exerciseName> ``` ALSO this changes the exercise system to index by name for `run` and `hint`, so: ``` rustlings run exercises/if/if1.rs ``` becomes ``` rustlings run if1 ```
Refactor hints Breaking change. This removes hints from the end of files, and puts them into `info.toml`. You can now access hints using: ``` rustlings hint <exerciseName> ``` ALSO this changes the exercise system to index by name for `run` and `hint`, so: ``` rustlings run exercises/if/if1.rs ``` becomes ``` rustlings run if1 ```
Breaking change. This removes hints from the end of files, and puts them into
info.toml
. You can now access hints using:ALSO this changes the exercise system to index by name for
run
andhint
, so:becomes