ngn@lemy.lol to Programmer Humor@lemmy.mlEnglish · 2 年前got himlemy.lolimagemessage-square129linkfedilinkarrow-up1461arrow-down136
arrow-up1425arrow-down1imagegot himlemy.lolngn@lemy.lol to Programmer Humor@lemmy.mlEnglish · 2 年前message-square129linkfedilink
minus-squareRustyNova@lemmy.worldlinkfedilinkarrow-up1·2 年前Oh, 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.
Oh, 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.