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

Avoid pulling core::fmt for PackingError when unwrapping #76

Merged
merged 1 commit into from
Nov 17, 2022

Conversation

jedrzejboczar
Copy link
Contributor

In my comment I said that all the fmt was being pulled due to my application code, but I actually didn't notice that I was testing with slight modifications to usbd-human-interface-device. I reviewed my changes and it looks like fmt was being pulled due to .pack().expect(...) (besides my unwrapping of UsbHidError).

This PR fixes the problem by dropping the PackingError before calling expect. I also included a minor fix that avoids hex formatting in one panic!. I think that the fixed-string message should give enough context (you could add log::error! if more context is needed).

@dlkj dlkj merged commit 1f4fd48 into dlkj:main Nov 17, 2022
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.

2 participants