Remove panic path in write_register(), associated with potential incorrect register slicing#20
Merged
jerrysxie merged 6 commits intoOpenDevicePartnership:mainfrom Dec 16, 2025
Conversation
kurtjd
previously approved these changes
Dec 10, 2025
kurtjd
left a comment
There was a problem hiding this comment.
Looks good, though this counts as a breaking change I believe since the BQ25773Error is not marked non_exhaustive.
Contributor
Author
I realized i never published this crate, so i added a commit here that enables the semver check. It will fail for now, but once i get 2 approvals, i will cargo publish and re-run CI and i should be able to merge then |
RobertZ2011
previously approved these changes
Dec 10, 2025
jerrysxie
previously requested changes
Dec 11, 2025
7996230 to
7dcb29b
Compare
felipebalbi
approved these changes
Dec 15, 2025
kurtjd
previously approved these changes
Dec 15, 2025
felipebalbi
requested changes
Dec 15, 2025
kurtjd
approved these changes
Dec 15, 2025
felipebalbi
approved these changes
Dec 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and fixes to the project, focusing on error handling in the register interface, lint configuration, and CI workflow enhancements. The most significant changes are grouped below by theme.
Error Handling and Robustness:
RegisterSizeErrorvariant to theBQ25773Errorenum and updated the async register write implementation insrc/lib.rsto explicitly check buffer sizes and return this error if the data does not fit, instead of usingdebug_assert!. This improves runtime safety and error reporting. [1] [2] [3]clippy::unwrap_used, ensuring that test code does not fail linting due to unwrap usage.Lint and Metadata Improvements:
Cargo.tomlkeywords to better reflect the crate’s scope, and updated clippy lint settings to use stricter enforcement (denyinstead offorbid) and to add more lint categories for improved code quality. [1] [2]Continuous Integration Enhancements:
semverjob in the GitHub Actions workflow (.github/workflows/check.yml) to check for semantic versioning compatibility on each run, improving release safety.