Skip to content

Consider reinstating str_to_string and string_to_string #5610

Closed
@ndmitchell

Description

@ndmitchell

The rules str_to_string and string_to_string have both been removed, so things like "foo".to_string() can no longer be warned for. I find those warnings very valuable, and have been "manually" linting them in code reviews. In particular, it's useful to distinguish between converting something to a string (relatively rare. deserves special attention in code review) and managing memory so it has the right form (very common, can mostly be glossed over). I think it's reasonable that these hints are off-by-default, and in the pedantic category, but they are certainly something I'd turn on.

FWIW, I went through clippy to try and implement the above hints, while is when I found they had previously been implemented and removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsgood 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