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

No longer force unwrap footer result #41

Merged
merged 3 commits into from
Jun 17, 2023
Merged

Conversation

aidantwoods
Copy link
Owner

Avoid force unwrapping here. I ended up using UnwrappedResults() erroneously to match the existing signature ([]byte, error) over Results() which would more safely return (*[]byte, error). The existing signature is the way it is because []byte can have a nil state, which isn't expressible at a generic level.

Add some special casing to transform the Option[[]byte] into []byte by mapping the None case to nil == []byte{}.

@aidantwoods aidantwoods merged commit be67f28 into main Jun 17, 2023
@aidantwoods aidantwoods deleted the remove-force-unwrap-footer branch June 17, 2023 09:42
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.

1 participant