#[cfg(any(feature = "debug", debug_assertions))]
#[macro_export]
macro_rules! heap_debug {
($fmt:expr) => {
$crate::ext::debug(&$crate::format!($fmt))
};
($fmt:expr, $($args:tt)*) => {
$crate::ext::debug(&$crate::format!($fmt, $($args)*))
};
}
#[cfg(not(any(feature = "debug", debug_assertions)))]
#[allow(missing_docs)]
#[macro_export]
macro_rules! heap_debug {
($fmt:expr) => {};
($fmt:expr, $($args:tt)*) => {};
}
#[macro_export]
macro_rules! dbg {
() => {
$crate::debug!("[{}:{}:{}]", $crate::prelude::file!(), $crate::prelude::line!(), $crate::prelude::column!())
};
($val:expr $(,)?) => {
match $val {
tmp => {
$crate::debug!("[{}:{}:{}] {} = {:#?}",
$crate::prelude::file!(),
$crate::prelude::line!(),
$crate::prelude::column!(),
$crate::prelude::stringify!($val),
&tmp,
);
tmp
}
}
};
($($val:expr),+ $(,)?) => {
($($crate::dbg!($val)),+,)
};
}