1 A pattern binding is using the same name as one of the variants of a type.
3 Erroneous code example:
12 fn is_empty(s: Method) -> bool {
22 Enum variants are qualified by default. For example, given this type:
31 You would match it using:
47 If you don't qualify the names, the code will bind new variables named "GET" and
48 "POST" instead. This behavior is likely not what you want, so `rustc` warns when
51 Qualified names are good practice, and most code works well with them. But if
52 you prefer them unqualified, you can import the variants into scope:
56 enum Method { GET, POST }
60 If you want others to be able to import variants from your module directly, use
65 pub enum Method { GET, POST }