Skip to content

non_ascii_literal example should be more verbose #4117

@ghost

Description

Currently, the doc for non_ascii_literal isn't showing what to do better.

I think including a "Could be written:" example would be helpful. Just like clippy does in the console.

Instead of just let x = "Hä?".
Something like this would be better.

 String::from("€");
    |         ^^^
    |
    = help: Consider replacing the string with:
            ""\u{20ac}""

I can make a PR, if someone tells me where I can find this lint :)

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