From eac624b58b0a616824016dda491934562ee21171 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 19 Oct 2024 08:46:11 -0700 Subject: [PATCH] Work around needless_raw_string_hashes pedantic clippy lint in test 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 ~ {}", | --- tests/test_formatdoc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_formatdoc.rs b/tests/test_formatdoc.rs index 5e47795..8027a6c 100644 --- a/tests/test_formatdoc.rs +++ b/tests/test_formatdoc.rs @@ -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); }