ngn@lemy.lol to Programmer Humor@lemmy.mlEnglish · 6 months agogot himlemy.lolimagemessage-square29fedilinkarrow-up14arrow-down10
arrow-up14arrow-down1imagegot himlemy.lolngn@lemy.lol to Programmer Humor@lemmy.mlEnglish · 6 months agomessage-square29fedilink
minus-squareDoods@infosec.publinkfedilinkarrow-up0arrow-down1·edit-26 months agoHow about this one? it more closely mirrors the switch example: match suffix { 'G' | 'g' => mem -= 30, 'M' | 'm' => mem -= 20, 'K' | 'k' => mem -= 10, _ => {}, } How about this other one? it goes as far as cloning the switch example’s indentation: match suffix { 'G' | 'g' => { mem -= 30; } 'M' | 'm' => { mem -= 20; } 'K' | 'k' => { mem -= 10; } _ => {}, }
How about this one? it more closely mirrors the switch example:
match suffix { 'G' | 'g' => mem -= 30, 'M' | 'm' => mem -= 20, 'K' | 'k' => mem -= 10, _ => {}, }
How about this other one? it goes as far as cloning the switch example’s indentation:
match suffix { 'G' | 'g' => { mem -= 30; } 'M' | 'm' => { mem -= 20; } 'K' | 'k' => { mem -= 10; } _ => {}, }