Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upReplace usage of try! with ? #331
Conversation
kaj left a comment
|
Seems fine to me, does what it says. |
| .ok_or(()) | ||
| .or_else(|()| f(self)) | ||
| .or_else(|()| io_error("URL has no port number"))) | ||
| .or_else(|()| io_error("URL has no port number"))? |
This comment has been minimized.
This comment has been minimized.
SimonSapin
May 9, 2017
Member
Please re-align these lines. (untry should have shown a warning about multi-line replacement.)
This comment has been minimized.
This comment has been minimized.
SamWhited
May 9, 2017
Author
Contributor
Fixed; is there a specific set of rustfmt settings that should be used? I tried to use it originally but it realigned a ton of other stuff so I left any sort of alignment issues alone. Thanks!
This comment has been minimized.
This comment has been minimized.
SimonSapin
May 9, 2017
Member
rustfmt does a lot more things than just replacing try!. If we’re gonna go down that road I’d prefer to go all the way and enforce rustfmt-like style in CI. But that seems more disruptive than I wanted to get into right now, so I recommended untry instead.
This comment has been minimized.
This comment has been minimized.
SamWhited
May 9, 2017
Author
Contributor
Ah, I see; untry gave me some warning about beign deprecated in favor of rustfmt; anyways, doesn't matter, fixed now. Thanks!
|
Great, thanks! @bors-servo r+ |
|
|
Replace usage of try! with ? Replaces all uses of `try!` with the `?` operator. Fixes #330 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-url/331) <!-- Reviewable:end -->
|
|
SamWhited commentedMay 9, 2017
•
edited by larsbergstrom
Replaces all uses of
try!with the?operator.Fixes #330
This change is