defmt/export/
integers.rs

1use super::*;
2
3macro_rules! write_to_le_bytes {
4    ($($s:ident),*) => {
5        $(/// Implementation detail
6        pub fn $s(b: &$s) {
7            write(&b.to_le_bytes())
8        })*
9    };
10}
11
12write_to_le_bytes!(u8, u16, u32, u64, u128, i8, i16, i32, i64, i128);
13
14/// Implementation detail
15pub fn usize(b: &usize) {
16    write(&(*b as u32).to_le_bytes())
17}
18
19/// Implementation detail
20pub fn isize(b: &isize) {
21    write(&(*b as i32).to_le_bytes())
22}