mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-10-02 14:54:30 +00:00
Generalize ufmt and dfmt for StringInner
This commit is contained in:
parent
4de426154e
commit
2f1dc46463
@ -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,
|
||||||
{
|
{
|
||||||
|
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user