use nix::libc::c_uint;
macro_rules! define_format_uint {
($vis:vis $name:ident, $type:ty) => {
#[doc = ::core::concat!("[`", ::core::stringify!($type), "`]")]
$vis const fn $name(
mut n: $type,
) -> (
[u8; (::core::mem::size_of::<$type>() * 8 * 7 + 22) / 23],
usize,
) {
let mut buf = [
b'0'; (::core::mem::size_of::<$type>() * 8 * 7 + 22) / 23
];
let mut i = buf.len() - (n == 0) as usize;
while n > 0 {
i -= 1;
buf[i] = b'0' + (n % 10) as u8;
n /= 10;
}
(buf, i)
}
};
}
define_format_uint!(pub format_c_uint, c_uint);
define_format_uint!(pub format_u32, u32);