Generalize ufmt and dfmt for StringInner

This commit is contained in:
Sosthène Guédon 2024-07-01 09:49:42 +02:00
parent 4de426154e
commit 2f1dc46463
No known key found for this signature in database
GPG Key ID: 36DA48A4C827B354
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
//! Defmt implementations for heapless types //! Defmt implementations for heapless types
use crate::{storage::Storage, vec::VecInner}; use crate::{storage::Storage, string::StringInner, vec::VecInner};
use defmt::Formatter; use defmt::Formatter;
impl<T, S: Storage> defmt::Format for VecInner<T, S> impl<T, S: Storage> defmt::Format for VecInner<T, S>
@ -12,7 +12,7 @@ where
} }
} }
impl<const N: usize> defmt::Format for crate::String<N> impl<S: Storage> defmt::Format for StringInner<S>
where where
u8: defmt::Format, u8: defmt::Format,
{ {

View File

@ -1,7 +1,7 @@
use crate::{storage::Storage, string::String, vec::VecInner}; use crate::{storage::Storage, string::StringInner, vec::VecInner};
use ufmt_write::uWrite; use ufmt_write::uWrite;
impl<const N: usize> uWrite for String<N> { impl<S: Storage> uWrite for StringInner<S> {
type Error = (); type Error = ();
fn write_str(&mut self, s: &str) -> Result<(), Self::Error> { fn write_str(&mut self, s: &str) -> Result<(), Self::Error> {
self.push_str(s) self.push_str(s)