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 @@
// modules1.rs
// Make me compile! Scroll down for hints :)
// Make me compile! Execute `rustlings hint modules1` for hints :)
mod sausage_factory {
fn make_sausage() {
@@ -10,34 +10,3 @@ mod sausage_factory {
fn main() {
sausage_factory::make_sausage();
}
// Everything is private in Rust by default-- but there's a keyword we can use
// to make something public! The compiler error should point to the thing that
// needs to be public.

View File

@@ -1,5 +1,5 @@
// modules2.rs
// Make me compile! Scroll down for hints :)
// Make me compile! Execute `rustlings hint modules2` for hints :)
mod delicious_snacks {
use self::fruits::PEAR as fruit;
@@ -23,25 +23,3 @@ fn main() {
delicious_snacks::veggie
);
}
// The delicious_snacks module is trying to present an external
// interface (the `fruit` and `veggie` constants) that is different than
// its internal structure (the `fruits` and `veggies` modules and
// associated constants). It's almost there except for one keyword missing for
// each constant.