Skip to content

Commit

Permalink
Change eprintln -> warning
Browse files Browse the repository at this point in the history
I added another brace block to the warning macro
because I was getting a compile error without them.
  • Loading branch information
richiksc committed Jun 6, 2019
1 parent 4b769a2 commit 463c0d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ fn main() {
if opt.open_in_browser {
match open::that(output_path) {
Ok(_) => (),
Err(_) => eprintln!("There was an error opening the browser."),
Err(_) => warning!("There was an error opening the browser."),
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ macro_rules! error {

macro_rules! warning {
($fmt:expr) => {
use colored::*;
println!(concat!("{}: ", $fmt), if cfg!(windows) { "warning".normal() } else { "warning".bold().yellow() });
{
use colored::*;
println!(concat!("{}: ", $fmt), if cfg!(windows) { "warning".normal() } else { "warning".bold().yellow() });
}
};
($fmt:expr, $($arg:tt)*) => {
use colored::*;
Expand Down

0 comments on commit 463c0d5

Please sign in to comment.