-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #271 - jrvidal:refactor, r=fmoko
refactor: exercise evaluation After working a bit on #270, I realized that it'd be useful to first perform a minor refactor of exercise evaluation. * Now we have standard methods to compile + execute that return `Result`s. * Success/failure messages are standardized.
- Loading branch information
Showing
5 changed files
with
167 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
); | ||
}}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters