From 1774794b191c7e14b178aee8a18dcfd34dd002a8 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 26 Sep 2023 19:05:12 -0700 Subject: [PATCH] Resolve needless_raw_string_hashes clippy lint in test warning: unnecessary hashes around raw string literal --> test_suite/tests/test_annotations.rs:2722:9 | 2722 | r#"invalid type: unit value, expected variant identifier"#, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = 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 | 2722 - r#"invalid type: unit value, expected variant identifier"#, 2722 + r"invalid type: unit value, expected variant identifier", | warning: unnecessary hashes around raw string literal --> test_suite/tests/test_annotations.rs:2743:9 | 2743 | r#"invalid type: unit value, expected variant identifier"#, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = 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 | 2743 - r#"invalid type: unit value, expected variant identifier"#, 2743 + r"invalid type: unit value, expected variant identifier", | warning: unnecessary hashes around raw string literal --> test_suite/tests/test_annotations.rs:2769:9 | 2769 | r#"invalid type: unit value, expected variant of enum Enum"#, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = 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 | 2769 - r#"invalid type: unit value, expected variant of enum Enum"#, 2769 + r"invalid type: unit value, expected variant of enum Enum", | warning: unnecessary hashes around raw string literal --> test_suite/tests/test_annotations.rs:2782:63 | 2782 | assert_de_tokens_error::(&[Token::Str("Untagged")], r#"something strange..."#); | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = 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 | 2782 - assert_de_tokens_error::(&[Token::Str("Untagged")], r#"something strange..."#); 2782 + assert_de_tokens_error::(&[Token::Str("Untagged")], r"something strange..."); | warning: unnecessary hashes around raw string literal --> test_suite/tests/test_annotations.rs:2803:9 | 2803 | r#"invalid type: unit value, expected something strange..."#, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = 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 | 2803 - r#"invalid type: unit value, expected something strange..."#, 2803 + r"invalid type: unit value, expected something strange...", | warning: unnecessary hashes around raw string literal --> test_suite/tests/test_annotations.rs:2812:9 | 2812 | r#"invalid type: map, expected something strange..."#, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = 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 | 2812 - r#"invalid type: map, expected something strange..."#, 2812 + r"invalid type: map, expected something strange...", | warning: unnecessary hashes around raw string literal --> test_suite/tests/test_annotations.rs:2817:9 | 2817 | r#"invalid type: unit value, expected something strange..."#, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = 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 | 2817 - r#"invalid type: unit value, expected something strange..."#, 2817 + r"invalid type: unit value, expected something strange...", | warning: unnecessary hashes around raw string literal --> test_suite/tests/test_annotations.rs:2828:9 | 2828 | r#"invalid type: map, expected something strange..."#, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = 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 | 2828 - r#"invalid type: map, expected something strange..."#, 2828 + r"invalid type: map, expected something strange...", | --- test_suite/tests/test_annotations.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test_suite/tests/test_annotations.rs b/test_suite/tests/test_annotations.rs index fa314cbc..17ff486b 100644 --- a/test_suite/tests/test_annotations.rs +++ b/test_suite/tests/test_annotations.rs @@ -2719,7 +2719,7 @@ fn test_expecting_message_externally_tagged_enum() { // Check that #[serde(expecting = "...")] doesn't affect variant identifier error message assert_de_tokens_error::( &[Token::Enum { name: "Enum" }, Token::Unit], - r#"invalid type: unit value, expected variant identifier"#, + r"invalid type: unit value, expected variant identifier", ); } @@ -2740,7 +2740,7 @@ fn test_expecting_message_internally_tagged_enum() { // Check that #[serde(expecting = "...")] doesn't affect variant identifier error message assert_de_tokens_error::( &[Token::Map { len: None }, Token::Str("tag"), Token::Unit], - r#"invalid type: unit value, expected variant identifier"#, + r"invalid type: unit value, expected variant identifier", ); } @@ -2766,7 +2766,7 @@ fn test_expecting_message_adjacently_tagged_enum() { // Check that #[serde(expecting = "...")] doesn't affect variant identifier error message assert_de_tokens_error::( &[Token::Map { len: None }, Token::Str("tag"), Token::Unit], - r#"invalid type: unit value, expected variant of enum Enum"#, + r"invalid type: unit value, expected variant of enum Enum", ); } @@ -2779,7 +2779,7 @@ fn test_expecting_message_untagged_tagged_enum() { Untagged, } - assert_de_tokens_error::(&[Token::Str("Untagged")], r#"something strange..."#); + assert_de_tokens_error::(&[Token::Str("Untagged")], r"something strange..."); } #[test] @@ -2800,7 +2800,7 @@ fn test_expecting_message_identifier_enum() { assert_de_tokens_error::( &[Token::Unit], - r#"invalid type: unit value, expected something strange..."#, + r"invalid type: unit value, expected something strange...", ); assert_de_tokens_error::( @@ -2809,12 +2809,12 @@ fn test_expecting_message_identifier_enum() { Token::Str("Unknown"), Token::None, ], - r#"invalid type: map, expected something strange..."#, + r"invalid type: map, expected something strange...", ); assert_de_tokens_error::( &[Token::Unit], - r#"invalid type: unit value, expected something strange..."#, + r"invalid type: unit value, expected something strange...", ); assert_de_tokens_error::( @@ -2825,7 +2825,7 @@ fn test_expecting_message_identifier_enum() { Token::Str("Unknown"), Token::None, ], - r#"invalid type: map, expected something strange..."#, + r"invalid type: map, expected something strange...", ); }