mirror of
https://github.com/notohh/rustlings.git
synced 2025-07-10 09:59:16 -04:00
feat: Refactor hint system
Hints are now accessible using the CLI subcommand `rustlings hint <exercise name`. BREAKING CHANGE: This fundamentally changes the way people interact with exercises.
This commit is contained in:
parent
627cdc07d0
commit
9bdb0a12e4
47 changed files with 400 additions and 1681 deletions
exercises/functions
|
@ -1,5 +1,5 @@
|
|||
// functions4.rs
|
||||
// Make me compile! Scroll down for hints :)
|
||||
// Make me compile! Execute `rustlings hint functions4` for hints :)
|
||||
|
||||
// This store is having a sale where if the price is an even number, you get
|
||||
// 10 (money unit) off, but if it's an odd number, it's 3 (money unit) less.
|
||||
|
@ -20,25 +20,3 @@ fn sale_price(price: i32) -> {
|
|||
fn is_even(num: i32) -> bool {
|
||||
num % 2 == 0
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// The error message points to line 12 and says it expects a type after the
|
||||
// `->`. This is where the function's return type should be-- take a look at
|
||||
// the `is_even` function for an example!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue