struct SomeStruct; impl SomeStruct { fn new(ctor: MixedInts) { match ctor { _ => println!("Match arms can construct the type in different ways"), } } } enum MixedInts { SmallInt(i32), TwoSmallInts(i32, i32), } fn main() { use MixedInts::*; let s = SomeStruct::new(SmallInt(32)); let s2 = SomeStruct::new(TwoSmallInts(32, 64)); }