Skip to content

Commit 18e9b89

Browse files
committed
Resolve needless_raw_string_hashes pedantic clippy lint in test
warning: unnecessary hashes around raw string literal --> tests/test.rs:2313:16 | 2313 | assert_eq!(r#"42"#, array_from_str[1].get()); | ^^^^^^^ | = 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 | 2313 - assert_eq!(r#"42"#, array_from_str[1].get()); 2313 + assert_eq!(r"42", array_from_str[1].get()); | warning: unnecessary hashes around raw string literal --> tests/test.rs:2315:16 | 2315 | assert_eq!(r#"null"#, array_from_str[3].get()); | ^^^^^^^^^ | = 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 string literal | 2315 - assert_eq!(r#"null"#, array_from_str[3].get()); 2315 + assert_eq!(r"null", array_from_str[3].get()); | warning: unnecessary hashes around raw string literal --> tests/test.rs:2392:16 | 2392 | assert_eq!(r#"42"#, array_from_str[1].get()); | ^^^^^^^ | = 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 string literal | 2392 - assert_eq!(r#"42"#, array_from_str[1].get()); 2392 + assert_eq!(r"42", array_from_str[1].get()); | warning: unnecessary hashes around raw string literal --> tests/test.rs:2394:16 | 2394 | assert_eq!(r#"null"#, array_from_str[3].get()); | ^^^^^^^^^ | = 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 string literal | 2394 - assert_eq!(r#"null"#, array_from_str[3].get()); 2394 + assert_eq!(r"null", array_from_str[3].get()); | warning: unnecessary hashes around raw string literal --> tests/test.rs:2399:16 | 2399 | assert_eq!(r#"42"#, array_from_reader[1].get()); | ^^^^^^^ | = 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 string literal | 2399 - assert_eq!(r#"42"#, array_from_reader[1].get()); 2399 + assert_eq!(r"42", array_from_reader[1].get()); | warning: unnecessary hashes around raw string literal --> tests/test.rs:2401:16 | 2401 | assert_eq!(r#"null"#, array_from_reader[3].get()); | ^^^^^^^^^ | = 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 string literal | 2401 - assert_eq!(r#"null"#, array_from_reader[3].get()); 2401 + assert_eq!(r"null", array_from_reader[3].get()); |
1 parent 62839b7 commit 18e9b89

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/test.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,9 +2311,9 @@ fn test_borrowed_raw_value() {
23112311
let array_from_str: Vec<&RawValue> =
23122312
serde_json::from_str(r#"["a", 42, {"foo": "bar"}, null]"#).unwrap();
23132313
assert_eq!(r#""a""#, array_from_str[0].get());
2314-
assert_eq!(r#"42"#, array_from_str[1].get());
2314+
assert_eq!("42", array_from_str[1].get());
23152315
assert_eq!(r#"{"foo": "bar"}"#, array_from_str[2].get());
2316-
assert_eq!(r#"null"#, array_from_str[3].get());
2316+
assert_eq!("null", array_from_str[3].get());
23172317

23182318
let array_to_string = serde_json::to_string(&array_from_str).unwrap();
23192319
assert_eq!(r#"["a",42,{"foo": "bar"},null]"#, array_to_string);
@@ -2390,16 +2390,16 @@ fn test_boxed_raw_value() {
23902390
let array_from_str: Vec<Box<RawValue>> =
23912391
serde_json::from_str(r#"["a", 42, {"foo": "bar"}, null]"#).unwrap();
23922392
assert_eq!(r#""a""#, array_from_str[0].get());
2393-
assert_eq!(r#"42"#, array_from_str[1].get());
2393+
assert_eq!("42", array_from_str[1].get());
23942394
assert_eq!(r#"{"foo": "bar"}"#, array_from_str[2].get());
2395-
assert_eq!(r#"null"#, array_from_str[3].get());
2395+
assert_eq!("null", array_from_str[3].get());
23962396

23972397
let array_from_reader: Vec<Box<RawValue>> =
23982398
serde_json::from_reader(br#"["a", 42, {"foo": "bar"}, null]"#.as_ref()).unwrap();
23992399
assert_eq!(r#""a""#, array_from_reader[0].get());
2400-
assert_eq!(r#"42"#, array_from_reader[1].get());
2400+
assert_eq!("42", array_from_reader[1].get());
24012401
assert_eq!(r#"{"foo": "bar"}"#, array_from_reader[2].get());
2402-
assert_eq!(r#"null"#, array_from_reader[3].get());
2402+
assert_eq!("null", array_from_reader[3].get());
24032403

24042404
let array_to_string = serde_json::to_string(&array_from_str).unwrap();
24052405
assert_eq!(r#"["a",42,{"foo": "bar"},null]"#, array_to_string);

0 commit comments

Comments
 (0)