macro_rules! print_flush {
($lit:expr) => {
print_flush!($lit,)
};
($lit:expr, $($arg:expr),*) => {
{
use ::std::io::Write;
print!($lit, $($arg),*);
::std::io::stdout().flush().expect("Failed Flushing stdout");
}
}
}
macro_rules! format_err {
($error:expr, $str:expr) => {
$error(format!($str))
};
($error:expr, $str:expr, $($arg:expr),*) => {
$error(format!($str, $($arg),*))
}
}
macro_rules! bail_fmt {
($error:expr, $str:expr) => {
bail!(format_err!($error, $str))
};
($error:expr, $str:expr, $($arg:expr),*) => {
bail!(format_err!($error, $str, $($arg),*))
}
}