#[cfg(feature = "std")]
#[macro_export]
macro_rules! dformat {
($template:literal, $($args:tt)*) => {{
#[cfg(not(feature = "std"))]
use alloc::format;
Ok(format!($template, $($args)*)) as Result<String, $crate::Error>
}};
($template:expr, $($args:tt)*) => {
$crate::__internal__dfmt!(true, $template, $($args)*)
};
}
#[cfg(not(feature = "std"))]
#[macro_export]
macro_rules! dformat {
($template:literal, $($args:tt)*) => {{
Ok(alloc::format!($template, $($args)*)) as Result<String, $crate::Error>
}};
($template:expr, $($args:tt)*) => {
$crate::__internal__dfmt!(true, $template, $($args)*)
};
}
#[cfg(feature = "std")]
#[macro_export]
macro_rules! dformat_unchecked {
($template:literal, $($args:tt)*) => {{
format!($template, $($args)*)
}};
($template:expr, $($args:tt)*) => {
$crate::__internal__dfmt!(false, $template, $($args)*).unwrap()
};
}
#[cfg(not(feature = "std"))]
#[macro_export]
macro_rules! dformat_unchecked {
($template:literal, $($args:tt)*) => {{
alloc::format!($template, $($args)*)
}};
($template:expr, $($args:tt)*) => {
$crate::__internal__dfmt!(false, $template, $($args)*).unwrap()
};
}