Skip to content

single_char_pattern doesn't recognize scape sequences #3075

Open
@gnzlbg

Description

@gnzlbg

Example (playground):

string.find("\"");

errors with

  |
3 |     string.find("\"");
  |                ^^^^ help: try using a char instead: `'\"'`
  |
  = note: #[warn(single_char_pattern)] on by default
  = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#single_char_pattern

However, the appropriate char to use is '"' without the escape: \.

Metadata

Metadata

Assignees

No one assigned

    Labels

    L-suggestionLint: Improving, adding or fixing lint suggestions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions