1//! Defmt implementations for heapless types
2//!
3
4use crate::Vec;
5use defmt::Formatter;
6
7impl<T, const N: usize> defmt::Format for Vec<T, N>
8where
9 T: defmt::Format,
10{
11 fn format(&self, fmt: Formatter<'_>) {
12 defmt::write!(fmt, "{=[?]}", self.as_slice())
13 }
14}
15
16impl<const N: usize> defmt::Format for crate::String<N>
17where
18 u8: defmt::Format,
19{
20 fn format(&self, fmt: Formatter<'_>) {
21 defmt::write!(fmt, "{=str}", self.as_str());
22 }
23}
24