Closed avlec closed 1 year ago
I would be happy to review such a PR, and have for a few other crates, but I have used defmt yet personally (my projects all predate it), so I'm not one that can test the implementation
I did a quick little test locally and just adding it how I did with the error from JSON de-serialization helped me understand that the decoder yielded this error TrailingCharacters
which quickly led me to understand I needed to properly size my slice to from_slice. Would there be anywhere else these messages might be useful?
In general, the most useful approach I have seen is adding defmt::Format
to the Error
types, so for this library, it would be serde_json_core::ser::Error
and serde_json_core::de::Error
Working on a an embedded project where there is the ability to log errors and structures with defmt, this does require adding a new conditional dependency and adding a conditional derive as follows. This would be particularly useful for reporting errors from JSON de-serialization.