159 lines
5.7 KiB
Text
159 lines
5.7 KiB
Text
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:18:13
|
|
|
|
|
LL | None {} => 0,
|
|
| ^^^ help: remove the struct pattern
|
|
|
|
|
= note: `-D clippy::unneeded-struct-pattern` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::unneeded_struct_pattern)]`
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:24:13
|
|
|
|
|
LL | None { .. } => 0,
|
|
| ^^^^^^^ help: remove the struct pattern
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:35:18
|
|
|
|
|
LL | Some(None {}) => 0,
|
|
| ^^^ help: remove the struct pattern
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:37:13
|
|
|
|
|
LL | None {} => 0,
|
|
| ^^^ help: remove the struct pattern
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:41:16
|
|
|
|
|
LL | if let None {} = Some(0) {}
|
|
| ^^^ help: remove the struct pattern
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:43:16
|
|
|
|
|
LL | if let None { .. } = Some(0) {}
|
|
| ^^^^^^^ help: remove the struct pattern
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:45:21
|
|
|
|
|
LL | if let Some(None {}) = Some(Some(0)) {}
|
|
| ^^^ help: remove the struct pattern
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:47:13
|
|
|
|
|
LL | let None {} = Some(0) else { panic!() };
|
|
| ^^^ help: remove the struct pattern
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:49:13
|
|
|
|
|
LL | let None { .. } = Some(0) else { panic!() };
|
|
| ^^^^^^^ help: remove the struct pattern
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:51:18
|
|
|
|
|
LL | let Some(None {}) = Some(Some(0)) else { panic!() };
|
|
| ^^^ help: remove the struct pattern
|
|
|
|
error: this match could be replaced by its body itself
|
|
--> tests/ui/unneeded_struct_pattern.rs:77:5
|
|
|
|
|
LL | / match Custom::Init {
|
|
LL | | _ => 0,
|
|
LL | | };
|
|
| |_____^ help: consider using the match body instead: `0`
|
|
|
|
|
= note: `-D clippy::match-single-binding` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::match_single_binding)]`
|
|
|
|
error: this match could be replaced by its body itself
|
|
--> tests/ui/unneeded_struct_pattern.rs:82:5
|
|
|
|
|
LL | / match Custom::Init {
|
|
LL | |
|
|
LL | | _ => 0,
|
|
LL | | };
|
|
| |_____^ help: consider using the match body instead: `0`
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:96:30
|
|
|
|
|
LL | if let Custom::NoBrackets {} = Custom::Init {
|
|
| ^^^ help: remove the struct pattern
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:100:30
|
|
|
|
|
LL | if let Custom::NoBrackets { .. } = Custom::Init {
|
|
| ^^^^^^^ help: remove the struct pattern
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:104:30
|
|
|
|
|
LL | if let Custom::NoBrackets {} | Custom::NoBracketsNonExhaustive {} = Custom::Init {
|
|
| ^^^ help: remove the struct pattern
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:104:67
|
|
|
|
|
LL | if let Custom::NoBrackets {} | Custom::NoBracketsNonExhaustive {} = Custom::Init {
|
|
| ^^^ help: remove the struct pattern
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:109:43
|
|
|
|
|
LL | if let Custom::NoBracketsNonExhaustive {} = Custom::Init {
|
|
| ^^^ help: remove the struct pattern
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:113:43
|
|
|
|
|
LL | if let Custom::NoBracketsNonExhaustive { .. } = Custom::Init {
|
|
| ^^^^^^^ help: remove the struct pattern
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:130:27
|
|
|
|
|
LL | let Custom::NoBrackets { .. } = Custom::Init else {
|
|
| ^^^^^^^ help: remove the struct pattern
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:134:40
|
|
|
|
|
LL | let Custom::NoBracketsNonExhaustive {} = Custom::Init else {
|
|
| ^^^ help: remove the struct pattern
|
|
|
|
error: struct pattern is not needed for a unit variant
|
|
--> tests/ui/unneeded_struct_pattern.rs:138:40
|
|
|
|
|
LL | let Custom::NoBracketsNonExhaustive { .. } = Custom::Init else {
|
|
| ^^^^^^^ help: remove the struct pattern
|
|
|
|
error: this match could be replaced by its body itself
|
|
--> tests/ui/unneeded_struct_pattern.rs:157:5
|
|
|
|
|
LL | / match ExhaustiveUnit {
|
|
LL | |
|
|
LL | | // Exhaustive variant
|
|
LL | | _ => 0,
|
|
LL | | };
|
|
| |_____^ help: consider using the match body instead: `0`
|
|
|
|
error: this match could be replaced by its body itself
|
|
--> tests/ui/unneeded_struct_pattern.rs:163:5
|
|
|
|
|
LL | / match ExhaustiveUnit {
|
|
LL | |
|
|
LL | | // Exhaustive variant
|
|
LL | | _ => 0,
|
|
LL | | };
|
|
| |_____^ help: consider using the match body instead: `0`
|
|
|
|
error: aborting due to 23 previous errors
|
|
|