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
{{ message }}
This repository has been archived by the owner on Jun 13, 2020. It is now read-only.
Liam suggested also allowing the use of if when destructuring a union enum. It would look something like the following:
x := thisReturnsAnOption();
if Some(val) := x {
// Do stuff with val
}
I'm not sure if I find this neccesary as we have match statement, but what does everybody think?
If we were to implement this the by far easiest way is to transform it into the equivalent match structure, as to not special case things further. That would mean that we turn the previous if into:
match x {
Some(val) => {
// Do stuff with val
}
_ => {},
}
The text was updated successfully, but these errors were encountered:
Liam suggested also allowing the use of if when destructuring a union enum. It would look something like the following:
I'm not sure if I find this neccesary as we have match statement, but what does everybody think?
If we were to implement this the by far easiest way is to transform it into the equivalent match structure, as to not special case things further. That would mean that we turn the previous if into:
The text was updated successfully, but these errors were encountered: