Skip to content

Do not lint write_with_newline when there is more than one newline #2990

@dtolnay

Description

@dtolnay

My code uses:

write!(file, "// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT\n\n")?;

I believe the above is clearer than Clippy's suggestion, in which one newline is written by the macro and one newline is written by my string:

writeln!(file, "// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT\n")?;

Mentioning @estk who worked on this lint in #2630.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesI-false-positiveIssue: The lint was triggered on code it shouldn't have

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions