I have an enum:
enum Group {
OfTwo {
first: usize,
second: usize,
},
OfThree {
one: usize,
two: usize,
three: usize,
},
}
I would like to write a function that only takes as argument the Group::OfTwo variant:
fn proceed_pair(pair: Group::OfTwo) {}
But when I do that, I get the message:
error[E0573]: expected type, found variant `Group::OfTwo`
--> src/lib.rs:13:23
|
13 | fn proceed_pair(pair: Group::OfTwo) {}
| ^^^^^^^^^^^^
| |
| not a type
| help: try using the variant's enum: `crate::Group`
Is there a way to achieve this?