|
1 | 1 | error: use of `expect` followed by a function call
|
2 |
| - --> $DIR/expect_fun_call.rs:29:26 |
| 2 | + --> $DIR/expect_fun_call.rs:35:26 |
3 | 3 | |
|
4 | 4 | LL | with_none_and_format.expect(&format!("Error {}: fake error", error_code));
|
5 | 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("Error {}: fake error", error_code))`
|
6 | 6 | |
|
7 | 7 | = note: `-D clippy::expect-fun-call` implied by `-D warnings`
|
8 | 8 |
|
9 | 9 | error: use of `expect` followed by a function call
|
10 |
| - --> $DIR/expect_fun_call.rs:32:26 |
| 10 | + --> $DIR/expect_fun_call.rs:38:26 |
11 | 11 | |
|
12 | 12 | LL | with_none_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
|
13 | 13 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("Error {}: fake error", error_code))`
|
14 | 14 |
|
15 | 15 | error: use of `expect` followed by a function call
|
16 |
| - --> $DIR/expect_fun_call.rs:42:25 |
| 16 | + --> $DIR/expect_fun_call.rs:41:37 |
| 17 | + | |
| 18 | +LL | with_none_and_format_with_macro.expect(format!("Error {}: fake error", one!()).as_str()); |
| 19 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("Error {}: fake error", one!()))` |
| 20 | + |
| 21 | +error: use of `expect` followed by a function call |
| 22 | + --> $DIR/expect_fun_call.rs:51:25 |
17 | 23 | |
|
18 | 24 | LL | with_err_and_format.expect(&format!("Error {}: fake error", error_code));
|
19 | 25 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| panic!("Error {}: fake error", error_code))`
|
20 | 26 |
|
21 | 27 | error: use of `expect` followed by a function call
|
22 |
| - --> $DIR/expect_fun_call.rs:45:25 |
| 28 | + --> $DIR/expect_fun_call.rs:54:25 |
23 | 29 | |
|
24 | 30 | LL | with_err_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
|
25 | 31 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| panic!("Error {}: fake error", error_code))`
|
26 | 32 |
|
27 | 33 | error: use of `expect` followed by a function call
|
28 |
| - --> $DIR/expect_fun_call.rs:57:17 |
| 34 | + --> $DIR/expect_fun_call.rs:66:17 |
29 | 35 | |
|
30 | 36 | LL | Some("foo").expect(format!("{} {}", 1, 2).as_ref());
|
31 | 37 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("{} {}", 1, 2))`
|
32 | 38 |
|
33 | 39 | error: use of `expect` followed by a function call
|
34 |
| - --> $DIR/expect_fun_call.rs:78:21 |
| 40 | + --> $DIR/expect_fun_call.rs:87:21 |
35 | 41 | |
|
36 | 42 | LL | Some("foo").expect(&get_string());
|
37 | 43 | | ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_string()) })`
|
38 | 44 |
|
39 | 45 | error: use of `expect` followed by a function call
|
40 |
| - --> $DIR/expect_fun_call.rs:79:21 |
| 46 | + --> $DIR/expect_fun_call.rs:88:21 |
41 | 47 | |
|
42 | 48 | LL | Some("foo").expect(get_string().as_ref());
|
43 | 49 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_string()) })`
|
44 | 50 |
|
45 | 51 | error: use of `expect` followed by a function call
|
46 |
| - --> $DIR/expect_fun_call.rs:80:21 |
| 52 | + --> $DIR/expect_fun_call.rs:89:21 |
47 | 53 | |
|
48 | 54 | LL | Some("foo").expect(get_string().as_str());
|
49 | 55 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_string()) })`
|
50 | 56 |
|
51 | 57 | error: use of `expect` followed by a function call
|
52 |
| - --> $DIR/expect_fun_call.rs:82:21 |
| 58 | + --> $DIR/expect_fun_call.rs:91:21 |
53 | 59 | |
|
54 | 60 | LL | Some("foo").expect(get_static_str());
|
55 | 61 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_static_str()) })`
|
56 | 62 |
|
57 | 63 | error: use of `expect` followed by a function call
|
58 |
| - --> $DIR/expect_fun_call.rs:83:21 |
| 64 | + --> $DIR/expect_fun_call.rs:92:21 |
59 | 65 | |
|
60 | 66 | LL | Some("foo").expect(get_non_static_str(&0));
|
61 | 67 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_non_static_str(&0).to_string()) })`
|
62 | 68 |
|
63 | 69 | error: use of `expect` followed by a function call
|
64 |
| - --> $DIR/expect_fun_call.rs:87:16 |
| 70 | + --> $DIR/expect_fun_call.rs:96:16 |
65 | 71 | |
|
66 | 72 | LL | Some(true).expect(&format!("key {}, {}", 1, 2));
|
67 | 73 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("key {}, {}", 1, 2))`
|
68 | 74 |
|
69 | 75 | error: use of `expect` followed by a function call
|
70 |
| - --> $DIR/expect_fun_call.rs:93:17 |
| 76 | + --> $DIR/expect_fun_call.rs:102:17 |
71 | 77 | |
|
72 | 78 | LL | opt_ref.expect(&format!("{:?}", opt_ref));
|
73 | 79 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("{:?}", opt_ref))`
|
74 | 80 |
|
75 |
| -error: aborting due to 12 previous errors |
| 81 | +error: aborting due to 13 previous errors |
76 | 82 |
|
0 commit comments