Skip to content

Spot where str::replace is used with the same argument #1595

Closed
@leonardo-m

Description

@leonardo-m

I'd like Clippy to spot this bug, where the two arguments of replace are the same:

fn foo3(txt: &str) -> String {
    txt.replace("0", "0")
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions