what if i need to if let on the result of another if let
if let
Oh, then you use and_then() or something similar.
and_then()
There's also the possibility to use the guard clauses patern and do let <...> = <...> else {}.
let <...> = <...> else {}
And finally, you can always split into another function.
It's not straight rules. It depends on what makes it more readable for your case.
what about if on a boolean followed by an if let
if
Post funny things about programming here! (Or just rant about your favourite programming language.)
what if i need to
if leton the result of anotherif letOh, then you use
and_then()or something similar.There's also the possibility to use the guard clauses patern and do
let <...> = <...> else {}.And finally, you can always split into another function.
It's not straight rules. It depends on what makes it more readable for your case.
what about
ifon a boolean followed by anif let