Skip to content

writeln_empty_string contains hardcoded suggestion #3016

@mati865

Description

@mati865

Actual output:

warning: using `writeln!(v, "")`
   --> src/main.rs:106:9
    |
106 |         writeln!(out, "").unwrap();
    |         ^^^^^^^^^^^^^^^^^ help: replace it with: `writeln!(v)`
    |
    = note: #[warn(writeln_empty_string)] on by default
    = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#writeln_empty_string

Expected output:

warning: using `writeln!(out, "")`
   --> src/main.rs:106:9
    |
106 |         writeln!(out, "").unwrap();
    |         ^^^^^^^^^^^^^^^^^ help: replace it with: `writeln!(out)`
    |
    = note: #[warn(writeln_empty_string)] on by default
    = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#writeln_empty_string

See lines:
https://github.com/rust-lang-nursery/rust-clippy/pull/2630/files#diff-2e8e94b55639a4808cb93bcc616d2d92R238
https://github.com/rust-lang-nursery/rust-clippy/pull/2630/files#diff-2e8e94b55639a4808cb93bcc616d2d92R240

cc @oli-obk for missing it during review 🤣

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesL-suggestionLint: Improving, adding or fixing lint suggestionsgood 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