-
Notifications
You must be signed in to change notification settings - Fork 10
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
Remove .unwrap
s and .expect
s
#25
Conversation
There is no good reason for it so your PR is welcome. I think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this PR. Taking care of the error handling is definitey a good thing to do.
I would suggest to ensure then that it is complete by creating a config.toml
under .cargo
with content such as here so we enforce with clippy that unwrap
are not used at all.
7524f7f
to
3791279
Compare
Please don't force push unless absolutely required. |
I disagree for force pushes. While a branch has not been merged to the trunk, it's common practice to update it and to change its history (aka "clean your branch"). For instance, say a reviewer finds a typo in a PR: the proposer just has to fix it, git absorb, and push force-with-lease. Of course, when it has been merged, changing its history is a no-go. |
3791279
to
27dcb14
Compare
Ok there are no I didn't read your message before about clippy. While it's actually possible to remove them all from the current code, as this PR does, I'm still puzzled about its ban. I think That said, I failed to have Clippy warm against it. Neithor with |
Did you use nightly ? |
Both the GitHub UI and CLI tooling has ways to compare changes between series of commits before and after a force push to make incremental PR review easy whether dealing with new commits or rewritten history. |
@chevdor I wasn't aware of the |
There is a rule for unwrap. There are a few options:
|
that would be for the better. Let me know once you are happy on your end with the state of this PR. |
27dcb14
to
429fa34
Compare
Well Note that clap's So I think I'm done! |
Some idiomatic construct.
I was actually interested in displaying more human-friendly error messages (see
throw
) but saw you always usepanic
. I'm used to returnanyhow::Result
. Then, just replace all.unwrap()
with?
. It not as human-friendly as a CLI should be, but at least it displays the error's source chain.