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

question_mark: don't add as_ref() for a call expression #5481

Merged
merged 1 commit into from
Apr 17, 2020

Conversation

sinkuu
Copy link
Contributor

@sinkuu sinkuu commented Apr 17, 2020

If a call returns a !Copy value, it does so regardless of whether as_ref() is added. For example, foo.into_option().as_ref()? can be simplified to foo.into_option()?.


changelog: Improved question_mark lint suggestion so that it doesn't add redundant as_ref()

@phansch phansch self-requested a review April 17, 2020 06:17
@phansch
Copy link
Member

phansch commented Apr 17, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Apr 17, 2020

📌 Commit f58bb5b has been approved by phansch

@bors
Copy link
Contributor

bors commented Apr 17, 2020

⌛ Testing commit f58bb5b with merge 82be9dc...

@bors
Copy link
Contributor

bors commented Apr 17, 2020

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: phansch
Pushing 82be9dc to master...

@bors bors merged commit 82be9dc into rust-lang:master Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants