2022-11-21 19:34:47 +00:00
|
|
|
error: this could be rewritten as `let...else`
|
|
|
|
--> $DIR/manual_let_else_match.rs:32:5
|
|
|
|
|
|
|
|
|
LL | / let v = match g() {
|
|
|
|
LL | | Some(v_some) => v_some,
|
|
|
|
LL | | None => return,
|
|
|
|
LL | | };
|
|
|
|
| |______^ help: consider writing: `let Some(v_some) = g() else { return };`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::manual-let-else` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: this could be rewritten as `let...else`
|
|
|
|
--> $DIR/manual_let_else_match.rs:37:5
|
|
|
|
|
|
|
|
|
LL | / let v = match g() {
|
|
|
|
LL | | Some(v_some) => v_some,
|
|
|
|
LL | | _ => return,
|
|
|
|
LL | | };
|
|
|
|
| |______^ help: consider writing: `let Some(v_some) = g() else { return };`
|
|
|
|
|
|
|
|
error: this could be rewritten as `let...else`
|
|
|
|
--> $DIR/manual_let_else_match.rs:44:9
|
|
|
|
|
|
|
|
|
LL | / let v = match h() {
|
|
|
|
LL | | (Some(v), None) | (None, Some(v)) => v,
|
2023-02-26 00:08:29 +00:00
|
|
|
LL | | (Some(_), Some(_)) | (None, None) => continue,
|
2022-11-21 19:34:47 +00:00
|
|
|
LL | | };
|
2022-12-17 13:12:54 +00:00
|
|
|
| |__________^ help: consider writing: `let ((Some(v), None) | (None, Some(v))) = h() else { continue };`
|
2022-11-21 19:34:47 +00:00
|
|
|
|
|
|
|
error: this could be rewritten as `let...else`
|
|
|
|
--> $DIR/manual_let_else_match.rs:49:9
|
|
|
|
|
|
|
|
|
LL | / let v = match build_enum() {
|
|
|
|
LL | | Variant::Bar(v) | Variant::Baz(v) => v,
|
2023-02-26 00:08:29 +00:00
|
|
|
LL | | _ => continue,
|
2022-11-21 19:34:47 +00:00
|
|
|
LL | | };
|
2022-12-17 13:12:54 +00:00
|
|
|
| |__________^ help: consider writing: `let (Variant::Bar(v) | Variant::Baz(v)) = build_enum() else { continue };`
|
2022-11-21 19:34:47 +00:00
|
|
|
|
|
|
|
error: this could be rewritten as `let...else`
|
|
|
|
--> $DIR/manual_let_else_match.rs:57:5
|
|
|
|
|
|
|
|
|
LL | / let v = match f() {
|
|
|
|
LL | | Ok(v) => v,
|
|
|
|
LL | | Err(_) => return,
|
|
|
|
LL | | };
|
|
|
|
| |______^ help: consider writing: `let Ok(v) = f() else { return };`
|
|
|
|
|
|
|
|
error: this could be rewritten as `let...else`
|
|
|
|
--> $DIR/manual_let_else_match.rs:63:5
|
|
|
|
|
|
|
|
|
LL | / let v = match f().map_err(|_| ()) {
|
|
|
|
LL | | Ok(v) => v,
|
|
|
|
LL | | Err(()) => return,
|
|
|
|
LL | | };
|
|
|
|
| |______^ help: consider writing: `let Ok(v) = f().map_err(|_| ()) else { return };`
|
|
|
|
|
2022-12-17 13:12:54 +00:00
|
|
|
error: this could be rewritten as `let...else`
|
|
|
|
--> $DIR/manual_let_else_match.rs:70:5
|
|
|
|
|
|
|
|
|
LL | / let _value = match f {
|
|
|
|
LL | | Variant::Bar(_) | Variant::Baz(_) => (),
|
|
|
|
LL | | _ => return,
|
|
|
|
LL | | };
|
|
|
|
| |______^ help: consider writing: `let (Variant::Bar(_) | Variant::Baz(_)) = f else { return };`
|
|
|
|
|
2023-02-26 00:08:29 +00:00
|
|
|
error: this could be rewritten as `let...else`
|
|
|
|
--> $DIR/manual_let_else_match.rs:76:5
|
|
|
|
|
|
|
|
|
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 };`
|
|
|
|
|
|
|
|
error: aborting due to 8 previous errors
|
2022-11-21 19:34:47 +00:00
|
|
|
|