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

Replace usage of try! with ? #331

Merged
merged 1 commit into from May 9, 2017
Merged

Replace usage of try! with ? #331

merged 1 commit into from May 9, 2017

Conversation

@SamWhited
Copy link
Contributor

SamWhited commented May 9, 2017

Replaces all uses of try! with the ? operator.

Fixes #330


This change is Reviewable

@kaj
kaj approved these changes May 9, 2017
Copy link

kaj left a comment

Seems fine to me, does what it says.

src/lib.rs Outdated
.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.

@SimonSapin

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.

@SamWhited

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.

@SimonSapin

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.

@SamWhited

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!

Fixes #330

? or do not. There is no try.
@SimonSapin
Copy link
Member

SimonSapin commented May 9, 2017

Great, thanks!

@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented May 9, 2017

📌 Commit b4d7400 has been approved by SimonSapin

@bors-servo
Copy link
Contributor

bors-servo commented May 9, 2017

Testing commit b4d7400 with merge a46c4e9...

bors-servo added a commit that referenced this pull request May 9, 2017
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 -->
@bors-servo
Copy link
Contributor

bors-servo commented May 9, 2017

☀️ Test successful - status-travis
Approved by: SimonSapin
Pushing a46c4e9 to master...

@bors-servo bors-servo merged commit b4d7400 into servo:master May 9, 2017
3 of 4 checks passed
3 of 4 checks passed
code-review/reviewable 5 files, 1 discussion left (SimonSapin)
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@SamWhited SamWhited deleted the SamWhited:no_try branch May 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.