Skip to content

write_with_newline should not warn when "\n" is preceded by "\r" #4208

Closed

Description

@Geobert

Writing to a file, I need CRLF format so I have no other choice than using write with \r\n.

warning: using `write!()` with a format string that ends in a single newline, consider using `writeln!()` instead
  --> src\main.rs:49:13
   |
49 |             write!(out, "{}\r\n", line)?;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: #[warn(clippy::write_with_newline)] on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline

Activity

  1. added
    good first issueThese issues are a good way to get started with Clippy
    C-bugCategory: Clippy is not doing the correct thing
    on Jun 14, 2019
  2. added a commit that references this issue on Jun 16, 2019
  3. V1shvesh commented on Sep 10, 2019

    @V1shvesh

    Hey @Geobert @matthiaskrgr! Is this issue still relevant?

  4. flip1995 commented on Sep 11, 2019

    @flip1995
    Member

    Yes it is. matthiaskrgr/rust-clippy@588dcc8 didn't fix this back then, and I think @matthiaskrgr probably forgot about this in the mean time. So feel free to take this 👍

  5. V1shvesh commented on Sep 11, 2019

    @V1shvesh

    Awesome!

  6. bookshelfdave commented on Sep 13, 2019

    @bookshelfdave

    hi @V1shvesh are you working on this issue? If not, I have a fix.

  7. V1shvesh commented on Sep 16, 2019

    @V1shvesh

    @metadave I haven't worked on it yet, so feel free! Thanks!

  8. matthiaskrgr commented on Oct 2, 2019

    @matthiaskrgr
    Member

    PR has been integrated, I'm closing this. :)

  9. flip1995 commented on Oct 3, 2019

    @flip1995
    Member

    No, it's S-inactive-closed, not merged. Only thing left to do is to add a test and the PR is finished.

  10. added 2 commits that reference this issue on Nov 7, 2019
    5e1a7ae
    2df272b
  11. added 4 commits that reference this issue on Nov 7, 2019
    e84bbda
    d5078cd
    a2cde05
    180f870
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thinggood 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