-
Notifications
You must be signed in to change notification settings - Fork 346
Return Result<{Self,&Self,&mut Self}, _> instead of Result<(), _> to allow method chaining #375
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
Comments
Is this different from #299 ? I’d prefer not to make breaking changes until there’s a stronger need to do so. |
Not for Errors here, but for
Any reason for that? |
Thank you for your well-argumented constructive input to this discussion. |
To be able to It’d involve coordinating pull requests to dozens of projects, with almost as many maintainers. It’d be a big pain. |
Considering that Hyper (along with everyone else in the web domain) is at this moment preparing for a breaking change due to async/await stabilization, if ever there was a time to consider such a breaking change it would be now. |
Hyper no longer depends on rust-url. That being said, there was recently a breaking major release of rust-url, and it was, indeed, a big pain. |
I'm working on the issue #299 right now and I saw some methods return
Result<(), ()>
, the issue I mentionned is about making them return aParseResult<()>
, but wouldn't it be better if they returnedParseResult<Self>
, in order to allow method chaining with?
or (old)unwrap()
?This would actually be useful mainly for setters, I set up an actual list of them:
Could work on this, be I need to be validated by someone before.
The text was updated successfully, but these errors were encountered: