1 A pattern attempted to extract an incorrect number of fields from a variant.
3 Erroneous code example:
11 let x = Fruit::Apple(String::new(), String::new());
14 Fruit::Apple(a) => {}, // error!
19 A pattern used to match against an enum variant must provide a sub-pattern for
20 each field of the enum variant.
22 Here the `Apple` variant has two fields, and should be matched against like so:
26 Apple(String, String),
30 let x = Fruit::Apple(String::new(), String::new());
34 Fruit::Apple(a, b) => {},
39 Matching with the wrong number of fields has no sensible interpretation:
43 Apple(String, String),
47 let x = Fruit::Apple(String::new(), String::new());
51 Fruit::Apple(a) => {},
52 Fruit::Apple(a, b, c) => {},
56 Check how many fields the enum was declared with and ensure that your pattern