1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2025-06-15 00:04:58 +02:00

refactor: exercise evaluation

Exercise evaluation (compilation + execution) now uses Results
Success/failure messages are standardized
This commit is contained in:
Roberto Vidal
2020-02-20 20:11:53 +01:00
parent 83bbd9e82e
commit 43dc31193a
5 changed files with 168 additions and 94 deletions

23
src/ui.rs Normal file
View File

@ -0,0 +1,23 @@
macro_rules! warn {
($fmt:literal, $ex:expr) => {{
use console::{style, Emoji};
let formatstr = format!($fmt, $ex);
println!(
"{} {}",
style(Emoji("⚠️ ", "!")).red(),
style(formatstr).red()
);
}};
}
macro_rules! success {
($fmt:literal, $ex:expr) => {{
use console::{style, Emoji};
let formatstr = format!($fmt, $ex);
println!(
"{} {}",
style(Emoji("", "")).green(),
style(formatstr).green()
);
}};
}