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

refactor(iroh-net): Avoid using .unwrap() calls #2046

Merged
merged 13 commits into from
Feb 29, 2024
Merged

Conversation

flub
Copy link
Contributor

@flub flub commented Feb 28, 2024

Description

This is an attempt at an audit of all the .unwrap() calls in iroh-net.
A few are replaced by .expect() with clear reasons why they're
reasonable. Some are replaces by non-panicking versions which will
never take the failure branch because of the invariants that are
supposed to be upheld.

Closes #1528

Notes & open questions

This was surprisingly horrible and long to do. Oh well.
Worth reviewing in detail I'm afraid.

Change checklist

  • Self-review.
  • Documentation updates if relevant.
  • Tests if relevant.

This is an attempt at an audit of all the .unwrap() calls in iroh-net.
A few are replaced by .expect() with clear reasons why they're
reasonable.  Some are replaces by non-panicking versions which will
never take the failure branch because of the invariants that are
supposed to be upheld.

Closes #1528
@flub flub added this to the v0.14.0 milestone Feb 29, 2024
@flub flub added this pull request to the merge queue Feb 29, 2024
Merged via the queue into main with commit 827aa8d Feb 29, 2024
23 checks passed
@flub flub deleted the flub/iroh-net-no-unwrap branch February 29, 2024 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Audit usage of unwraps
2 participants