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