Skip to content

Commit 099ddba

Browse files
committed
Fix adjacent tests
1 parent 9b6ab06 commit 099ddba

6 files changed

+17
-15
lines changed

tests/ui/expect_fun_call.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-rustfix
22

33
#![warn(clippy::expect_fun_call)]
4+
#![allow(clippy::to_string_in_format_args)]
45

56
/// Checks implementation of the `EXPECT_FUN_CALL` lint
67

tests/ui/expect_fun_call.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-rustfix
22

33
#![warn(clippy::expect_fun_call)]
4+
#![allow(clippy::to_string_in_format_args)]
45

56
/// Checks implementation of the `EXPECT_FUN_CALL` lint
67

tests/ui/expect_fun_call.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,73 @@
11
error: use of `expect` followed by a function call
2-
--> $DIR/expect_fun_call.rs:28:26
2+
--> $DIR/expect_fun_call.rs:29:26
33
|
44
LL | with_none_and_format.expect(&format!("Error {}: fake error", error_code));
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("Error {}: fake error", error_code))`
66
|
77
= note: `-D clippy::expect-fun-call` implied by `-D warnings`
88

99
error: use of `expect` followed by a function call
10-
--> $DIR/expect_fun_call.rs:31:26
10+
--> $DIR/expect_fun_call.rs:32:26
1111
|
1212
LL | with_none_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("Error {}: fake error", error_code))`
1414

1515
error: use of `expect` followed by a function call
16-
--> $DIR/expect_fun_call.rs:41:25
16+
--> $DIR/expect_fun_call.rs:42:25
1717
|
1818
LL | with_err_and_format.expect(&format!("Error {}: fake error", error_code));
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| panic!("Error {}: fake error", error_code))`
2020

2121
error: use of `expect` followed by a function call
22-
--> $DIR/expect_fun_call.rs:44:25
22+
--> $DIR/expect_fun_call.rs:45:25
2323
|
2424
LL | with_err_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| panic!("Error {}: fake error", error_code))`
2626

2727
error: use of `expect` followed by a function call
28-
--> $DIR/expect_fun_call.rs:56:17
28+
--> $DIR/expect_fun_call.rs:57:17
2929
|
3030
LL | Some("foo").expect(format!("{} {}", 1, 2).as_ref());
3131
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("{} {}", 1, 2))`
3232

3333
error: use of `expect` followed by a function call
34-
--> $DIR/expect_fun_call.rs:77:21
34+
--> $DIR/expect_fun_call.rs:78:21
3535
|
3636
LL | Some("foo").expect(&get_string());
3737
| ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_string()) })`
3838

3939
error: use of `expect` followed by a function call
40-
--> $DIR/expect_fun_call.rs:78:21
40+
--> $DIR/expect_fun_call.rs:79:21
4141
|
4242
LL | Some("foo").expect(get_string().as_ref());
4343
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_string()) })`
4444

4545
error: use of `expect` followed by a function call
46-
--> $DIR/expect_fun_call.rs:79:21
46+
--> $DIR/expect_fun_call.rs:80:21
4747
|
4848
LL | Some("foo").expect(get_string().as_str());
4949
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_string()) })`
5050

5151
error: use of `expect` followed by a function call
52-
--> $DIR/expect_fun_call.rs:81:21
52+
--> $DIR/expect_fun_call.rs:82:21
5353
|
5454
LL | Some("foo").expect(get_static_str());
5555
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_static_str()) })`
5656

5757
error: use of `expect` followed by a function call
58-
--> $DIR/expect_fun_call.rs:82:21
58+
--> $DIR/expect_fun_call.rs:83:21
5959
|
6060
LL | Some("foo").expect(get_non_static_str(&0));
6161
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_non_static_str(&0).to_string()) })`
6262

6363
error: use of `expect` followed by a function call
64-
--> $DIR/expect_fun_call.rs:86:16
64+
--> $DIR/expect_fun_call.rs:87:16
6565
|
6666
LL | Some(true).expect(&format!("key {}, {}", 1, 2));
6767
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("key {}, {}", 1, 2))`
6868

6969
error: use of `expect` followed by a function call
70-
--> $DIR/expect_fun_call.rs:92:17
70+
--> $DIR/expect_fun_call.rs:93:17
7171
|
7272
LL | opt_ref.expect(&format!("{:?}", opt_ref));
7373
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("{:?}", opt_ref))`

tests/ui/format.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22

3-
#![allow(clippy::print_literal, clippy::redundant_clone)]
3+
#![allow(clippy::print_literal, clippy::redundant_clone, clippy::to_string_in_format_args)]
44
#![warn(clippy::useless_format)]
55

66
struct Foo(pub String);

tests/ui/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22

3-
#![allow(clippy::print_literal, clippy::redundant_clone)]
3+
#![allow(clippy::print_literal, clippy::redundant_clone, clippy::to_string_in_format_args)]
44
#![warn(clippy::useless_format)]
55

66
struct Foo(pub String);

tests/ui/to_string_in_display.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::to_string_in_display)]
2-
#![allow(clippy::inherent_to_string_shadow_display)]
2+
#![allow(clippy::inherent_to_string_shadow_display, clippy::to_string_in_format_args)]
33

44
use std::fmt;
55

0 commit comments

Comments
 (0)