-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uwrite with alloc::string::String? no_std target #31
Comments
I have the exact same question / problem. |
Lines 40 to 48 in 4cbb956
looks like |
It would be good to add a |
As a workaround one can make a newtype pub struct UString(pub String);
impl ufmt::uWrite for UString {
type Error = core::convert::Infallible;
fn write_str(&mut self, s: &str) -> Result<(), core::convert::Infallible> {
self.0.push_str(s);
Ok(())
}
}
impl ufmt::uDisplay for UString {
fn fmt<W>(&self, f: &mut ufmt::Formatter<'_, W>) -> Result<(), W::Error>
where
W: ufmt::uWrite + ?Sized,
{
<str as ufmt::uDisplay>::fmt(&self.0, f)
}
} |
Yup! That would be perfect |
Hi!
I am trying to craft a environment for my embedded board.
Trying to use ufmt uwrite! with alloc::string::String but getting such errors:
I already have a working allocator since the underlying system is based on nuttx and I just use libc_alloc with uses malloc and other options from directly nuttx libc.
I would be really grateful for any help, I am stuck with that currently
The text was updated successfully, but these errors were encountered: