Skip to content

Conversation

@andrewhickman
Copy link
Contributor

@andrewhickman andrewhickman commented Jan 20, 2023

Motivation

I tried using BinaryMetadataKey::from_bytes to parse a header value, but noticed it inconveniently panics on values that don't end in -bin.

Solution

I assume this is a bug since the signature of this function suggests it returns an error on failure, and the documentation makes no mention of panicking.

This PR fixes it to return an error instead.

The signature of this function suggests it returns an error on failure,
and the documentation makes no mention of panicking.
Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Thanks

@LucioFranco LucioFranco merged commit 930c805 into hyperium:master Feb 8, 2023
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