Rusty 🦀 Femboy 🏳️🌈@lemmy.blahaj.zone to Programmer Humor@lemmy.mlEnglish · 9 months agoI love Rustlemmy.blahaj.zoneexternal-linkmessage-square68linkfedilinkarrow-up11arrow-down10
arrow-up11arrow-down1external-linkI love Rustlemmy.blahaj.zoneRusty 🦀 Femboy 🏳️🌈@lemmy.blahaj.zone to Programmer Humor@lemmy.mlEnglish · 9 months agomessage-square68linkfedilink
minus-squarecopygirl@lemmy.blahaj.zonelinkfedilinkEnglisharrow-up0·9 months 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);
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: