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
In the match pattern Status::InProgress { assigned_to }, assigned_to is a binding.
We're destructuring the Status::InProgress variant and binding the assigned_to field to
a new variable,
[also named assigned_to.] <= this should be [named person]
If we wanted, we could bind the field to a different variable name:
match status {Status::InProgress{assigned_to: person } => {println!("Assigned to: {}", person);},Status::ToDo | Status::Done => {println!("Done");}}
The text was updated successfully, but these errors were encountered:
Bindings
In the match pattern
Status::InProgress { assigned_to }
,assigned_to
is a binding.We're destructuring the
Status::InProgress
variant and binding theassigned_to
field toa new variable,
[also named
assigned_to
.] <= this should be [namedperson
]If we wanted, we could bind the field to a different variable name:
The text was updated successfully, but these errors were encountered: