Skip to content

Use mem::take instead of mem::replace when applicable#4881

Merged
bors merged 8 commits intorust-lang:masterfrom
krishna-veerareddy:issue-4871-use-mem-take
Jan 4, 2020
Merged

Use mem::take instead of mem::replace when applicable#4881
bors merged 8 commits intorust-lang:masterfrom
krishna-veerareddy:issue-4871-use-mem-take

Conversation

@krishna-veerareddy
Copy link
Copy Markdown
Contributor

@krishna-veerareddy krishna-veerareddy commented Dec 4, 2019

std::mem::take can be used to replace a value of type T with T::default() instead of std::mem::replace.

Fixes issue #4871

changelog: Added lint for [mem_replace_with_default]

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lint Area: New lints S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants