aboutsummaryrefslogtreecommitdiff
path: root/src/macros.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/macros.rs')
-rw-r--r--src/macros.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/macros.rs b/src/macros.rs
index e35eeb90..8abad78d 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -14,17 +14,16 @@
#[macro_export]
macro_rules! die {
- ($($arg:tt)*) => {
- println!($($arg)*);
+ ($($arg:tt)*) => {{
+ err_println!($($arg)*);
::std::process::exit(1);
- }
+ }}
}
#[macro_export]
macro_rules! err_println {
- ($($arg:tt)*) => {
- if let Err(_) = writeln!(&mut ::std::io::stderr(), $($arg)*) {
- die!("Cannot reach stderr");
- }
- }
+ ($($arg:tt)*) => {{
+ use std::io::Write;
+ (writeln!(&mut ::std::io::stderr(), $($arg)*)).expect("stderr");
+ }}
}