Skip to content

New lint: Suggest usage of mem::take #4871

Closed
@krishna-veerareddy

Description

@krishna-veerareddy

mem::take is being stabilized in v1.40 so I was wondering if we should add a lint to detect occurences of mem::replace(&mut T, T::default()) and suggest usage of mem::take(&mut T) instead.

Let me know if this is something that's useful and I can start working on it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsL-complexityLint: Belongs in the complexity lint groupgood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions