2022-10-10 00:17:04 -05:00
|
|
|
error: this could be rewritten as `let...else`
|
2022-02-19 00:15:20 -06:00
|
|
|
--> $DIR/manual_let_else_match.rs:32:5
|
2022-02-15 19:10:42 -06:00
|
|
|
|
|
|
|
|
LL | / let v = match g() {
|
|
|
|
LL | | Some(v_some) => v_some,
|
|
|
|
LL | | None => return,
|
|
|
|
LL | | };
|
2023-02-01 04:17:39 -06:00
|
|
|
| |______^ help: consider writing: `let Some(v) = g() else { return };`
|
2022-02-15 19:10:42 -06:00
|
|
|
|
|
|
|
|
= note: `-D clippy::manual-let-else` implied by `-D warnings`
|
|
|
|
|
2022-10-10 00:17:04 -05:00
|
|
|
error: this could be rewritten as `let...else`
|
2022-02-19 00:15:20 -06:00
|
|
|
--> $DIR/manual_let_else_match.rs:37:5
|
2022-02-15 19:10:42 -06:00
|
|
|
|
|
|
|
|
LL | / let v = match g() {
|
|
|
|
LL | | Some(v_some) => v_some,
|
|
|
|
LL | | _ => return,
|
|
|
|
LL | | };
|
2023-02-01 04:17:39 -06:00
|
|
|
| |______^ help: consider writing: `let Some(v) = g() else { return };`
|
2022-02-15 19:10:42 -06:00
|
|
|
|
2022-10-10 00:17:04 -05:00
|
|
|
error: this could be rewritten as `let...else`
|
2022-02-19 00:15:20 -06:00
|
|
|
--> $DIR/manual_let_else_match.rs:44:9
|
2022-02-15 19:10:42 -06:00
|
|
|
|
|
|
|
|
LL | / let v = match h() {
|
2022-02-19 00:15:20 -06:00
|
|
|
LL | | (Some(v), None) | (None, Some(v)) => v,
|
2023-02-12 08:40:06 -06:00
|
|
|
LL | | (Some(_), Some(_)) | (None, None) => continue,
|
2022-02-19 00:15:20 -06:00
|
|
|
LL | | };
|
2022-11-26 10:21:07 -06:00
|
|
|
| |__________^ help: consider writing: `let ((Some(v), None) | (None, Some(v))) = h() else { continue };`
|
2022-02-19 00:15:20 -06:00
|
|
|
|
2022-10-10 00:17:04 -05:00
|
|
|
error: this could be rewritten as `let...else`
|
2022-02-19 00:15:20 -06:00
|
|
|
--> $DIR/manual_let_else_match.rs:49:9
|
|
|
|
|
|
|
|
|
LL | / let v = match build_enum() {
|
2022-02-15 19:10:42 -06:00
|
|
|
LL | | Variant::Bar(v) | Variant::Baz(v) => v,
|
2023-02-12 08:40:06 -06:00
|
|
|
LL | | _ => continue,
|
2022-02-15 19:10:42 -06:00
|
|
|
LL | | };
|
2022-11-26 10:21:07 -06:00
|
|
|
| |__________^ help: consider writing: `let (Variant::Bar(v) | Variant::Baz(v)) = build_enum() else { continue };`
|
2022-02-15 19:10:42 -06:00
|
|
|
|
2022-10-10 00:17:04 -05:00
|
|
|
error: this could be rewritten as `let...else`
|
2022-02-19 00:15:20 -06:00
|
|
|
--> $DIR/manual_let_else_match.rs:57:5
|
2022-02-15 19:10:42 -06:00
|
|
|
|
|
|
|
|
LL | / let v = match f() {
|
|
|
|
LL | | Ok(v) => v,
|
|
|
|
LL | | Err(_) => return,
|
|
|
|
LL | | };
|
2022-10-10 00:17:04 -05:00
|
|
|
| |______^ help: consider writing: `let Ok(v) = f() else { return };`
|
2022-02-15 19:10:42 -06:00
|
|
|
|
2022-10-10 00:17:04 -05:00
|
|
|
error: this could be rewritten as `let...else`
|
2022-02-19 00:15:20 -06:00
|
|
|
--> $DIR/manual_let_else_match.rs:63:5
|
|
|
|
|
|
|
|
|
LL | / let v = match f().map_err(|_| ()) {
|
|
|
|
LL | | Ok(v) => v,
|
|
|
|
LL | | Err(()) => return,
|
|
|
|
LL | | };
|
2022-10-10 00:17:04 -05:00
|
|
|
| |______^ help: consider writing: `let Ok(v) = f().map_err(|_| ()) else { return };`
|
2022-02-19 00:15:20 -06:00
|
|
|
|
2022-11-26 10:21:07 -06:00
|
|
|
error: this could be rewritten as `let...else`
|
|
|
|
--> $DIR/manual_let_else_match.rs:70:5
|
|
|
|
|
|
|
|
|
LL | / let _value = match f {
|
2023-05-18 03:33:35 -05:00
|
|
|
LL | | Variant::Bar(v) | Variant::Baz(v) => v,
|
2022-11-26 10:21:07 -06:00
|
|
|
LL | | _ => return,
|
|
|
|
LL | | };
|
2023-05-18 03:33:35 -05:00
|
|
|
| |______^ help: consider writing: `let (Variant::Bar(_value) | Variant::Baz(_value)) = f else { return };`
|
2022-11-26 10:21:07 -06:00
|
|
|
|
2023-02-12 08:40:06 -06:00
|
|
|
error: this could be rewritten as `let...else`
|
2023-06-01 11:55:24 -05:00
|
|
|
--> $DIR/manual_let_else_match.rs:75:5
|
|
|
|
|
|
|
|
|
LL | / let _value = match Some(build_enum()) {
|
|
|
|
LL | | Some(Variant::Bar(v) | Variant::Baz(v)) => v,
|
|
|
|
LL | | _ => return,
|
|
|
|
LL | | };
|
|
|
|
| |______^ help: consider writing: `let Some(Variant::Bar(_value) | Variant::Baz(_value)) = Some(build_enum()) else { return };`
|
|
|
|
|
|
|
|
error: this could be rewritten as `let...else`
|
|
|
|
--> $DIR/manual_let_else_match.rs:81:5
|
2023-02-12 08:40:06 -06:00
|
|
|
|
|
|
|
|
LL | / let data = match data.as_slice() {
|
|
|
|
LL | | [data @ .., 0, 0, 0, 0] | [data @ .., 0, 0] | [data @ .., 0] => data,
|
|
|
|
LL | | _ => return,
|
|
|
|
LL | | };
|
|
|
|
| |______^ help: consider writing: `let ([data @ .., 0, 0, 0, 0] | [data @ .., 0, 0] | [data @ .., 0]) = data.as_slice() else { return };`
|
|
|
|
|
2023-06-01 11:55:24 -05:00
|
|
|
error: aborting due to 9 previous errors
|
2022-02-15 19:10:42 -06:00
|
|
|
|