We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
#[defmt(transparent)]
Format
reading the doc
Newtypes If you need to implement Format for some "newtype" struct you can delegate the formatting to the inner type. Example below: struct MyU8 { inner: u8 } impl defmt::Format for MyU8 { fn format(&self, f: defmt::Formatter) { self.inner.format(f) } }
Newtypes If you need to implement Format for some "newtype" struct you can delegate the formatting to the inner type. Example below:
struct MyU8 { inner: u8 } impl defmt::Format for MyU8 { fn format(&self, f: defmt::Formatter) { self.inner.format(f) } }
I wonder if doing (on structs with one field only)
#[derive(defmt::Format)] #[defmt(transparent)] struct MyU8(u8);
wouldn't be nice for users 🤔.
A nice touch would be to also allow it on enums
#[derive(defmt::Format)] #[defmt(transparent)] enum MyEnum { U8(u8), MyPayload(MyPayload), }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
reading the doc
I wonder if doing (on structs with one field only)
wouldn't be nice for users 🤔.
A nice touch would be to also allow it on enums
The text was updated successfully, but these errors were encountered: