Is there a way to write
if a == 1 || a == 2 { //do something }
shorter? I know that in switch we can say:
switch a { case 1,2: //do something }
but this pattern doesn't work with if statement.
Aucun commentaire:
Enregistrer un commentaire