1 error: use of `expect` followed by a function call
2 --> $DIR/expect_fun_call.rs:28:26
4 LL | with_none_and_format.expect(&format!("Error {}: fake error", error_code));
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("Error {}: fake error", error_code))`
7 = note: `-D clippy::expect-fun-call` implied by `-D warnings`
9 error: use of `expect` followed by a function call
10 --> $DIR/expect_fun_call.rs:31:26
12 LL | with_none_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("Error {}: fake error", error_code))`
15 error: use of `expect` followed by a function call
16 --> $DIR/expect_fun_call.rs:41:25
18 LL | with_err_and_format.expect(&format!("Error {}: fake error", error_code));
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| panic!("Error {}: fake error", error_code))`
21 error: use of `expect` followed by a function call
22 --> $DIR/expect_fun_call.rs:44:25
24 LL | with_err_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| panic!("Error {}: fake error", error_code))`
27 error: use of `expect` followed by a function call
28 --> $DIR/expect_fun_call.rs:56:17
30 LL | Some("foo").expect(format!("{} {}", 1, 2).as_ref());
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("{} {}", 1, 2))`
33 error: use of `expect` followed by a function call
34 --> $DIR/expect_fun_call.rs:77:21
36 LL | Some("foo").expect(&get_string());
37 | ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!(get_string()) })`
39 error: use of `expect` followed by a function call
40 --> $DIR/expect_fun_call.rs:78:21
42 LL | Some("foo").expect(get_string().as_ref());
43 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!(get_string()) })`
45 error: use of `expect` followed by a function call
46 --> $DIR/expect_fun_call.rs:79:21
48 LL | Some("foo").expect(get_string().as_str());
49 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!(get_string()) })`
51 error: use of `expect` followed by a function call
52 --> $DIR/expect_fun_call.rs:81:21
54 LL | Some("foo").expect(get_static_str());
55 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!(get_static_str()) })`
57 error: use of `expect` followed by a function call
58 --> $DIR/expect_fun_call.rs:82:21
60 LL | Some("foo").expect(get_non_static_str(&0));
61 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!(get_non_static_str(&0).to_string()) })`
63 error: use of `expect` followed by a function call
64 --> $DIR/expect_fun_call.rs:86:16
66 LL | Some(true).expect(&format!("key {}, {}", 1, 2));
67 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("key {}, {}", 1, 2))`
69 error: aborting due to 11 previous errors