From 9bdb0a12e45a8e9f9f6a4bd4a9c172c5376c7f60 Mon Sep 17 00:00:00 2001 From: marisa Date: Mon, 11 Nov 2019 16:51:38 +0100 Subject: feat: Refactor hint system Hints are now accessible using the CLI subcommand `rustlings hint , -// which is polymorphic-- that means that lots of different kinds of errors -// can be returned from the same function because all errors act the same -// since they all implement the `error::Error` trait. -// Check out this section of the book: -// https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html#a-shortcut-for-propagating-errors-the--operator - - - - - - - - - - - - - - - - - - - - -// Another another hint: Note that because the `?` operator returns -// the *unwrapped* value in the `Ok` case, if we want to return a `Result` from -// `read_and_validate` for *its* success case, we'll have to rewrap a value -// that we got from the return value of a `?`ed call in an `Ok`-- this will -// look like `Ok(something)`. - - - - - - - - - - - - - - - - - - - - -// Another another another hint: `Result`s must be "used", that is, you'll -// get a warning if you don't handle a `Result` that you get in your -// function. Read more about that in the `std::result` module docs: -// https://doc.rust-lang.org/std/result/#results-must-be-used -- cgit v1.2.3