Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Conversation

oceanlewis
Copy link
Contributor

@oceanlewis oceanlewis commented Jul 31, 2018

See #23

@LegNeato LegNeato self-requested a review August 1, 2018 00:49
Copy link
Collaborator

@LegNeato LegNeato left a comment

Choose a reason for hiding this comment

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

I think it will be cleaner to just use expect()

@LegNeato
Copy link
Collaborator

LegNeato commented Aug 1, 2018

Thanks for the PR! 🍻

@oceanlewis
Copy link
Contributor Author

I was using the current implementation because I wanted whatever Display implementation there is for that error to do its thing. Does expect() automatically use that the Display impl for that type?

@srijs
Copy link
Owner

srijs commented Aug 1, 2018

Another bit that might be nice to have is a custom error message. Currently we'll just wrap the raw env or parse error, which have fairly generic error messages, and it could be helpful to have a more descriptive message in these cases.

@oceanlewis
Copy link
Contributor Author

oceanlewis commented Aug 1, 2018

Yeah, that would be nice. But at least you get more info than an expect("Failed to make a new Runtime"). That might be a separate issue than this PR?

@LegNeato
Copy link
Collaborator

LegNeato commented Aug 1, 2018

Expect uses Debug for the underlying error rather than Display I believe:

https://doc.rust-lang.org/book/second-edition/ch09-02-recoverable-errors-with-result.html

@oceanlewis
Copy link
Contributor Author

Okay, yeah - if you'd prefer that I'll change it.

@LegNeato LegNeato merged commit 037fc3b into srijs:master Aug 1, 2018
@LegNeato
Copy link
Collaborator

LegNeato commented Aug 1, 2018

Great, thanks! I think we will leave the more in-depth changes for another PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants