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

Improve get_unwrap suggestion #3638

Merged
merged 2 commits into from Jan 7, 2019
Merged

Improve get_unwrap suggestion #3638

merged 2 commits into from Jan 7, 2019

Conversation

ghost
Copy link

@ghost ghost commented Jan 6, 2019

Handle case where a reference is immediately dereferenced.

Fixes #3625

Handle case where a reference is immediately dereferenced.

Fixes 3625
|
LL | *some_vecdeque.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&mut some_vecdeque[0]`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changed tests were get_mut() cases, maybe there should be a test for a get() case too?

@ghost
Copy link
Author

ghost commented Jan 7, 2019

I made the changes suggested.

@oli-obk
Copy link
Contributor

oli-obk commented Jan 7, 2019

@bors r+

another bug bites the dust

@bors
Copy link
Contributor

bors commented Jan 7, 2019

📌 Commit d2ea635 has been approved by oli-obk

@bors
Copy link
Contributor

bors commented Jan 7, 2019

⌛ Testing commit d2ea635 with merge 81fa266...

bors added a commit that referenced this pull request Jan 7, 2019
Improve `get_unwrap` suggestion

Handle case where a reference is immediately dereferenced.

Fixes #3625
@bors
Copy link
Contributor

bors commented Jan 7, 2019

☀️ Test successful - status-appveyor, status-travis
Approved by: oli-obk
Pushing 81fa266 to master...

@bors bors merged commit d2ea635 into rust-lang:master Jan 7, 2019
@ghost ghost deleted the fix-3625 branch January 8, 2019 06:12
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