Rusty 🦀 Femboy 🏳️🌈@lemmy.blahaj.zone to Programmer Humor@lemmy.mlEnglish · 5 months agoI love Rustlemmy.blahaj.zoneimagemessage-square74fedilinkarrow-up1325arrow-down124
arrow-up1301arrow-down1imageI love Rustlemmy.blahaj.zoneRusty 🦀 Femboy 🏳️🌈@lemmy.blahaj.zone to Programmer Humor@lemmy.mlEnglish · 5 months agomessage-square74fedilink
minus-squarecopygirl@lemmy.blahaj.zonelinkfedilinkEnglisharrow-up7·5 months agoThen you should also override Equals(object), GetHashCode, and implement IEquatable. 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·5 months 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
.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