Skip to content

Commit

Permalink
Work around needless_raw_string_hashes pedantic clippy lint in test
Browse files Browse the repository at this point in the history
    warning: unnecessary hashes around raw string literal
      --> tests/test_formatdoc.rs:65:29
       |
    65 |       let indoc = formatdoc! {r#"
       |  _____________________________^
    66 | |         {:?}
    67 | |
    68 | |             \\{}
    69 | |         {}"#,
       | |____________^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
       = note: `-W clippy::needless-raw-string-hashes` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::needless_raw_string_hashes)]`
    help: remove all the hashes around the string literal
       |
    65 ~     let indoc = formatdoc! {r"
    66 |         {:?}
    67 |
    68 |             \\{}
    69 ~         {}",
       |
  • Loading branch information
dtolnay committed Oct 19, 2024
1 parent 64949e1 commit eac624b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_formatdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ fn one_line() {
#[test]
fn raw_string() {
let indoc = formatdoc! {r#"
{:?}
{:?}"
\\{}
{}"#,
"a", 'b', 'c'
};
let expected = "\"a\"\n\n \\\\b\nc";
let expected = "\"a\"\"\n\n \\\\b\nc";
assert_eq!(indoc, expected);
}

Expand Down

0 comments on commit eac624b

Please sign in to comment.