20 lines
468 B
Rust
20 lines
468 B
Rust
//! Convenience macros.
|
|
#[macro_export]
|
|
macro_rules! eprintln {
|
|
($($tt:tt)*) => {{
|
|
if $crate::is_ci() {
|
|
panic!("Forgot to remove debug-print?")
|
|
}
|
|
std::eprintln!($($tt)*)
|
|
}}
|
|
}
|
|
|
|
/// Appends formatted string to a `String`.
|
|
#[macro_export]
|
|
macro_rules! format_to {
|
|
($buf:expr) => ();
|
|
($buf:expr, $lit:literal $($arg:tt)*) => {
|
|
{ use ::std::fmt::Write as _; let _ = ::std::write!($buf, $lit $($arg)*); }
|
|
};
|
|
}
|