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

enhancement: add edge case error handling #15

Merged
merged 10 commits into from
Jan 18, 2024
Merged

enhancement: add edge case error handling #15

merged 10 commits into from
Jan 18, 2024

Conversation

jsstevenson
Copy link
Member

@jsstevenson jsstevenson commented Jan 18, 2024

close #12

unwrap() is sort of like choosing to ignore possible errors. There are a couple cases where it's prudent/not burdensome to catch those errors (using let-else https://doc.rust-lang.org/rust-by-example/flow_control/let_else.html) and a couple where I think it's fine (errors come from using a different kind of value than what we're calling it with)

@jsstevenson jsstevenson requested review from korikuzma and removed request for korikuzma January 18, 2024 13:39
@jsstevenson jsstevenson marked this pull request as ready for review January 18, 2024 14:15
@jsstevenson jsstevenson added the priority:low Low priority label Jan 18, 2024
korikuzma
korikuzma previously approved these changes Jan 18, 2024
Comment on lines 10 to 11
assert result
assert len(result) == 1
Copy link
Member

Choose a reason for hiding this comment

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

For these, we could just stick with checking the len == 1

Suggested change
assert result
assert len(result) == 1
assert len(result) == 1

@jsstevenson jsstevenson merged commit 2de86f3 into main Jan 18, 2024
26 checks passed
@jsstevenson jsstevenson deleted the unwrap-tests branch January 18, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:low Low priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle unwrap()s/edge cases
2 participants