Thelie@sh.itjust.works to Programmer Humor@programming.devEnglish · 2 years agoProgramming as a hobby means I can do whatever I want!sh.itjust.worksimagemessage-square16linkfedilinkarrow-up1186arrow-down16
arrow-up1180arrow-down1imageProgramming as a hobby means I can do whatever I want!sh.itjust.worksThelie@sh.itjust.works to Programmer Humor@programming.devEnglish · 2 years agomessage-square16linkfedilink
minus-squareanton@lemmy.blahaj.zonelinkfedilinkarrow-up4·2 years agoInstead of if let Some(a_) = a{ () } else if let Some(b_)=b{ () } else { dostuff } you could just use if a.isNone()&&b.isNone(){ dostuff } Also if you don’t use the value in a match just use _
minus-squareThelie@sh.itjust.worksOPlinkfedilinkarrow-up1·2 years agoThat’s a good point, thanks. Maybe I’ll go without the if entirely, the (janky) code is still very much in flux ;)
Instead of
if let Some(a_) = a{ () } else if let Some(b_)=b{ () } else { dostuff }you could just use
if a.isNone()&&b.isNone(){ dostuff }Also if you don’t use the value in a match just use
_That’s a good point, thanks. Maybe I’ll go without the if entirely, the (janky) code is still very much in flux ;)