Rusty 🦀 Femboy 🏳️🌈@lemmy.blahaj.zone to Programmer Humor@lemmy.mlEnglish · 21 hours agoI love Rustlemmy.blahaj.zoneexternal-linkmessage-square42fedilinkarrow-up1210arrow-down115
arrow-up1195arrow-down1external-linkI love Rustlemmy.blahaj.zoneRusty 🦀 Femboy 🏳️🌈@lemmy.blahaj.zone to Programmer Humor@lemmy.mlEnglish · 21 hours agomessage-square42fedilink
minus-squarecopygirl@lemmy.blahaj.zonelinkfedilinkEnglisharrow-up6·17 hours agoThen you should also override Equals(object), GetHashCode, and implement IEquatable<T>. Thankfully a lot of the usual boilerplate code can be avoided using a record class or struct: public record Person(string Name, uint Age);
minus-squareGonzako@lemmy.worldlinkfedilinkarrow-up1·13 hours agoOh well, It does show how little I do have to actually use that. It just hasn’t come up that much
Then you should also override
Equals(object)
,GetHashCode
, and implementIEquatable<T>
.Thankfully a lot of the usual boilerplate code can be avoided using a
record
class or struct:Oh well, It does show how little I do have to actually use that. It just hasn’t come up that much