-
Notifications
You must be signed in to change notification settings - Fork 7
embedded-usb-pd: Audit panics #60
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
Conversation
e86645b to
5e04e7d
Compare
jerrysxie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kurtjd Don't forget about the corresponding changes in embedded-services.
Will announce this on Zulip and submit a PR for embedded-services. |
embedded-services PR: OpenDevicePartnership/embedded-services#664 |
Updates repo to the latest de-panicked `embedded-usb-pd`: OpenDevicePartnership/embedded-usb-pd#60
This PR audits potential panics. Most were cases that are easily proven to never panic (assuming the assumptions in the code are held) and these assumptions are defined very close to the potential panic path, so I think it was safe to allow these instead of returning an error.
A refactor of the
Argstype may help eliminate the need for unwraps (see: #61).Rdo::for_pdonow returns anOption<Self>and is public so a minor breaking change has been introduced.Resolves #59