You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building on #103, we should perhaps explain pattern matching when the data contained in an enum variant is a struct.
enumReason{Finished,Failed}enumAction{Send,Receive}enumMessage{Start,Process(Action),End{reason:Reason,timeout:u32}}match message {Message::Start => {/* pattern has no parameters */}Message::Process(Action::Send) => {/* two patterns in one */}Message::Process(a) => {/* grab the action as `a` */}Message::End{ reason, timeout } => {/* must match field names */}}
The text was updated successfully, but these errors were encountered:
Building on #103, we should perhaps explain pattern matching when the data contained in an enum variant is a struct.
The text was updated successfully, but these errors were encountered: