Skip to content

Conversation

@0xPoe
Copy link
Contributor

@0xPoe 0xPoe commented Dec 30, 2025

close #3984

Just avoid unwrap as much as possible. Use expect to assert that it will always succeed.

Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning these up!

Just one general comment that applies to several of these: it's never the body that would cause an error. It's only every status(), header(), or uri() that is parsing into an http type that could error. So the expect should mention "constant status won't error", instead of "missing should be valid".

@0xPoe
Copy link
Contributor Author

0xPoe commented Jan 7, 2026

It's only every status(), header(), or uri() that is parsing into an http type that could error. So the expect should mention "constant status won't error", instead of "missing should be valid".

Good point! Updated. Thank you.

Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

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

Perfect, thank you!

@seanmonstar seanmonstar merged commit 0f0b6ed into hyperium:master Jan 12, 2026
22 checks passed
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.

Examples full of unsafe usage of .unwrap()

2 participants