1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2025-06-23 00:28:46 +02: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:
marisa
2019-11-11 16:51:38 +01:00
parent 627cdc07d0
commit 9bdb0a12e4
47 changed files with 400 additions and 1681 deletions

View File

@ -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!