Resolve needless_raw_string_hashes clippy lint in test

warning: unnecessary hashes around raw string literal
       --> tests/test_error.rs:252:24
        |
    252 |       let yaml = indoc! {r#"
        |  ________________________^
    253 | |         ---
    254 | |         !V
    255 | |         value: 0
    256 | |     "#};
        | |______^
        |
        = 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::all`
        = help: to override `-W clippy::all` add `#[allow(clippy::needless_raw_string_hashes)]`
    help: remove all the hashes around the literal
        |
    252 ~     let yaml = indoc! {r"
    253 |         ---
    254 |         !V
    255 |         value: 0
    256 ~     "};
        |

    warning: unnecessary hashes around raw string literal
       --> tests/test_serde.rs:249:24
        |
    249 |       let yaml = indoc! {r#"
        |  ________________________^
    250 | |         ascii
    251 | |     "#};
        | |______^
        |
        = 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::all`
        = help: to override `-W clippy::all` add `#[allow(clippy::needless_raw_string_hashes)]`
    help: remove all the hashes around the literal
        |
    249 ~     let yaml = indoc! {r"
    250 |         ascii
    251 ~     "};
        |

    warning: unnecessary hashes around raw string literal
       --> tests/test_serde.rs:267:24
        |
    267 |       let yaml = indoc! {r#"
        |  ________________________^
    268 | |         🎉
    269 | |     "#};
        | |______^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
    help: remove all the hashes around the literal
        |
    267 ~     let yaml = indoc! {r"
    268 |         🎉
    269 ~     "};
        |

    warning: unnecessary hashes around raw string literal
       --> tests/test_serde.rs:284:24
        |
    284 |       let yaml = indoc! {r#"
        |  ________________________^
    285 | |         trailing_newline: |
    286 | |           aaa
    287 | |           bbb
    ...   |
    290 | |           bbb
    291 | |     "#};
        | |______^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
    help: remove all the hashes around the literal
        |
    284 ~     let yaml = indoc! {r"
    285 |         trailing_newline: |
      ...
    290 |           bbb
    291 ~     "};
        |

    warning: unnecessary hashes around raw string literal
       --> tests/test_serde.rs:310:24
        |
    310 |       let yaml = indoc! {r#"
        |  ________________________^
    311 | |         boolean: 'true'
    312 | |         integer: '1'
    313 | |         void: 'null'
    314 | |         leading_zeros: '007'
    315 | |     "#};
        | |______^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
    help: remove all the hashes around the literal
        |
    310 ~     let yaml = indoc! {r"
    311 |         boolean: 'true'
      ...
    314 |         leading_zeros: '007'
    315 ~     "};
        |
This commit is contained in:
David Tolnay 2023-09-26 19:07:30 -07:00
parent 635e4ff7a1
commit a777ab2028
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 10 additions and 10 deletions

View File

@ -249,11 +249,11 @@ fn test_variant_not_a_seq() {
enum E {
V(usize),
}
let yaml = indoc! {r#"
let yaml = indoc! {r"
---
!V
value: 0
"#};
"};
let expected = "invalid type: map, expected usize at line 2 column 1";
test_error::<E>(yaml, expected);
}

View File

@ -246,9 +246,9 @@ fn test_basic_struct() {
#[test]
fn test_string_escapes() {
let yaml = indoc! {r#"
let yaml = indoc! {r"
ascii
"#};
"};
test_serde(&"ascii".to_owned(), yaml);
let yaml = indoc! {r#"
@ -264,9 +264,9 @@ fn test_string_escapes() {
"#};
test_serde(&"\u{1f}\u{feff}".to_owned(), yaml);
let yaml = indoc! {r#"
let yaml = indoc! {r"
🎉
"#};
"};
test_serde(&"\u{1f389}".to_owned(), yaml);
}
@ -281,14 +281,14 @@ fn test_multiline_string() {
trailing_newline: "aaa\nbbb\n".to_owned(),
no_trailing_newline: "aaa\nbbb".to_owned(),
};
let yaml = indoc! {r#"
let yaml = indoc! {r"
trailing_newline: |
aaa
bbb
no_trailing_newline: |-
aaa
bbb
"#};
"};
test_serde(&thing, yaml);
}
@ -307,12 +307,12 @@ fn test_strings_needing_quote() {
void: "null".to_owned(),
leading_zeros: "007".to_owned(),
};
let yaml = indoc! {r#"
let yaml = indoc! {r"
boolean: 'true'
integer: '1'
void: 'null'
leading_zeros: '007'
"#};
"};
test_serde(&thing, yaml);
}