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

Error constructor methods should return Self instead of Result<(), Self> #279

Closed
fitzgen opened this issue Sep 5, 2018 · 4 comments
Closed
Assignees

Comments

@fitzgen
Copy link
Member

fitzgen commented Sep 5, 2018

There are places where we want to return an error in a method that returns Result<Something, Error> and are forced to do nasty things like Error::crate_config("...").map(|_| unreachable!()) to make it type check. At this point, it would be easier to just do Err(Error::crate_config("..")) everywhere after changing the Error constructors to return Self.

@fitzgen fitzgen added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers refactor labels Sep 5, 2018
@data-pup
Copy link
Member

data-pup commented Sep 6, 2018

I'd love to help out with this one! I remember doing this for #244, and pulling it out so the PR would be a little cleaner. I don't think it would be hard to do again 😸

@fitzgen fitzgen removed good first issue Good for newcomers help wanted Extra attention is needed labels Sep 6, 2018
@fitzgen
Copy link
Member Author

fitzgen commented Sep 6, 2018

Great! ^_^

@ashleygwilliams
Copy link
Member

@fitzgen now that we've shifted to using failure nearly entirely- is this out of date?

@fitzgen
Copy link
Member Author

fitzgen commented Jan 18, 2019

Yeah, I think this can be closed now!

@fitzgen fitzgen closed this as completed Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants