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

hvdef: make HvStatus type distinct from HvError #754

Merged
merged 4 commits into from
Jan 31, 2025

Conversation

jstarks
Copy link
Member

@jstarks jstarks commented Jan 31, 2025

HvError is supposed to represent a non-success status code, but it's also used for a possibly-successful status code in some places. Fix this by adding a new HvStatus type and making HvError a wrapper around NonZeroU16.

This also gives us a nice niche optimization, so that HvResult<(), HvError> is equivalent to HvStatus.

`HvError` is supposed to represent a non-success status code, but it's
also used for a possibly-successful status code in some places. Fix this
by adding a new `HvStatus` type and making `HvError` a wrapper around
`NonZeroU16`.

This also gives us a nice niche optimization, so that `HvResult<(),
HvError>` is equivalent to `HvStatus`.
@jstarks jstarks requested a review from a team as a code owner January 31, 2025 18:34
@jstarks jstarks merged commit 22362c3 into microsoft:main Jan 31, 2025
25 checks passed
@jstarks jstarks deleted the hvstatus branch January 31, 2025 22:12
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