Skip to content
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

add optional defmt support for error types #76

Closed
wants to merge 2 commits into from

Conversation

avlec
Copy link
Contributor

@avlec avlec commented Sep 22, 2023

add defmt as an optional dependent package

I am only able to test defmt v0.3.0 as the rest of my project is using that version the latest is at v0.3.5

closes #75

add defmt as an optional dependent package
Copy link
Member

@ryan-summers ryan-summers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good me to, thanks for adding it! Can you add an entry in CHANGELOG.md mentioning the change?

Copy link
Member

@ryan-summers ryan-summers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it would be good to run CI with --all-features, so maybe update .github/workflows/ci.yml as well if you're comfortable. If not, let me know and I'll do it :)

@avlec
Copy link
Contributor Author

avlec commented Sep 23, 2023

I hope I did the CI part properly if not feel free to amend that...
Edit: yeah you'll have to point out where the change is actually required or do an amend

@@ -19,6 +19,7 @@ pub type Result<T> = core::result::Result<T, Error>;
/// This type represents all possible errors that can occur when deserializing JSON data
#[derive(Debug, PartialEq, Eq, Clone)]
#[cfg_attr(not(feature = "custom-error-messages"), derive(Copy))]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
Copy link
Member

@ryan-summers ryan-summers Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to add:

        #[cfg_attr(feature = "defmt", defmt(defmt::Debug2Format))]

above the heapless::String<64> error type.

Copy link
Contributor

@Georges760 Georges760 Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or adding "defmt-impl" feature into the heapless dependency

@vhdirk
Copy link
Contributor

vhdirk commented Nov 4, 2023

Is there anything here I can help with to get this merged?

@ryan-summers
Copy link
Member

@vhdirk At this point, I would consider this PR abandoned. If you want to fork this current work and address my remaining comments, I'd be happy to review it as a separate PR :)

@Georges760
Copy link
Contributor

@vhdirk if you can't do it, i can also help, tell me

@ryan-summers
Copy link
Member

It's already being continued in #77 for now :)

@avlec
Copy link
Contributor Author

avlec commented Nov 21, 2023

@vhdirk Thanks for picking up where I started with this and getting it in there!

@avlec avlec deleted the defmt branch February 28, 2024 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Support defmt Formatting
4 participants