minus-squareQT1@feddit.detoRust@programming.dev•Question on holding related data in a struct.linkfedilinkarrow-up8arrow-down1·8 months agoYou could store the matches in a HashMap as well, using some MatchId type as the key, i.e., HashMap. Then you can use that as the reference in players: HashMap. Only downside is that you have to generate unique MatchIds, e.g., by using some counter. linkfedilink
minus-squareQT1@feddit.detoAsklemmy@lemmy.ml•Which fantasy or folklore creature would you marry?linkfedilinkarrow-up4·9 months agoHmm, I didn’t think that out. Still better than hair though linkfedilink
minus-squareQT1@feddit.detoAsklemmy@lemmy.ml•Which fantasy or folklore creature would you marry?linkfedilinkarrow-up33·9 months agoMedusa. She makes me rock hard. Also, no hair in the shower drain is a nice bonus. linkfedilink
You could store the matches in a
HashMap
as well, using someMatchId
type as the key, i.e.,HashMap
. Then you can use that as the reference inplayers: HashMap
. Only downside is that you have to generate uniqueMatchId
s, e.g., by using some counter.