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

Suggest .into() over try_into() when it would work #71051

Merged
merged 3 commits into from
Apr 13, 2020

Conversation

ryr3
Copy link
Contributor

@ryr3 ryr3 commented Apr 12, 2020

It would be better to suggest x.into() instead, which is shorter, cannot fail, and doesn't require importing a trait.
Tests have been added and made up to date.
Fixes #70851

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cramertj (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 12, 2020
@LeSeulArtichaut
Copy link
Contributor

r? @estebank who gave mentoring instructions

@rust-highfive rust-highfive assigned estebank and unassigned cramertj Apr 13, 2020
@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Apr 13, 2020

📌 Commit 5ffc1ab has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 13, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 13, 2020
Rollup of 5 pull requests

Successful merges:

 - rust-lang#70656 (Improve scrollbar display in rustdoc)
 - rust-lang#71051 (Suggest .into() over try_into() when it would work)
 - rust-lang#71087 (Remove `FnCtxt::impl_self_ty`)
 - rust-lang#71097 (Pattern docs)
 - rust-lang#71101 (Miri: let machine hook dynamically decide about alignment checks)

Failed merges:

r? @ghost
@bors bors merged commit f551d8a into rust-lang:master Apr 13, 2020
@ryr3 ryr3 deleted the fix_try_into branch July 1, 2020 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.try_into().unwrap() is suggested even when .into() would work
6 participants