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,7 +1,8 @@
// errors3.rs
// This is a program that is trying to use a completed version of the
// `total_cost` function from the previous exercise. It's not working though!
// Why not? What should we do to fix it? Scroll for hints!
// Why not? What should we do to fix it?
// Execute `rustlings hint errors3` for hints!
use std::num::ParseIntError;
@@ -26,22 +27,3 @@ pub fn total_cost(item_quantity: &str) -> Result<i32, ParseIntError> {
Ok(qty * cost_per_item + processing_fee)
}
// If other functions can return a `Result`, why shouldn't `main`?