|
1 | | -#![warn(clippy::literal_string_with_formatting_arg)] |
| 1 | +#![warn(clippy::literal_string_with_formatting_args)] |
2 | 2 | #![allow(clippy::unnecessary_literal_unwrap)] |
3 | 3 |
|
4 | 4 | fn main() { |
5 | 5 | let x: Option<usize> = None; |
6 | 6 | let y = "hello"; |
7 | | - x.expect("{y} {}"); //~ literal_string_with_formatting_arg |
8 | | - x.expect(" {y} bla"); //~ literal_string_with_formatting_arg |
9 | | - x.expect("{:?}"); //~ literal_string_with_formatting_arg |
10 | | - x.expect("{y:?}"); //~ literal_string_with_formatting_arg |
11 | | - x.expect(" {y:?} {y:?} "); //~ literal_string_with_formatting_arg |
12 | | - x.expect(" {y:..} {y:?} "); //~ literal_string_with_formatting_arg |
13 | | - x.expect(r"{y:?} {y:?} "); //~ literal_string_with_formatting_arg |
14 | | - x.expect(r"{y:?} y:?}"); //~ literal_string_with_formatting_arg |
15 | | - x.expect(r##" {y:?} {y:?} "##); //~ literal_string_with_formatting_arg |
| 7 | + x.expect("{y} {}"); //~ literal_string_with_formatting_args |
| 8 | + x.expect(" {y} bla"); //~ literal_string_with_formatting_args |
| 9 | + x.expect("{:?}"); //~ literal_string_with_formatting_args |
| 10 | + x.expect("{y:?}"); //~ literal_string_with_formatting_args |
| 11 | + x.expect(" {y:?} {y:?} "); //~ literal_string_with_formatting_args |
| 12 | + x.expect(" {y:..} {y:?} "); //~ literal_string_with_formatting_args |
| 13 | + x.expect(r"{y:?} {y:?} "); //~ literal_string_with_formatting_args |
| 14 | + x.expect(r"{y:?} y:?}"); //~ literal_string_with_formatting_args |
| 15 | + x.expect(r##" {y:?} {y:?} "##); //~ literal_string_with_formatting_args |
16 | 16 | // Ensure that it doesn't try to go in the middle of a unicode character. |
17 | | - x.expect("———{:?}"); //~ literal_string_with_formatting_arg |
| 17 | + x.expect("———{:?}"); //~ literal_string_with_formatting_args |
18 | 18 |
|
19 | 19 | // Should not lint! |
20 | 20 | format!("{y:?}"); |
|
0 commit comments