Gabriel Pettier on Nostr: npub129gva…e4kwg but i needed that to be able to implement Ord for the type, which ...
npub129gvast08lj986yftn7q5qlnj8yfqufxx0m33s9u5xssjm8c64rsve4kwg (npub129g…4kwg) but i needed that to be able to implement Ord for the type, which i needed to sort my struct using that type.
I resorted to reuse a method i had built to convert each to a number of points, leveraging it to use the integer comparison.
impl PartialEq for HandTypes {
fn eq(&self, other: &Self) -> bool {
self.to_num() == other.to_num()
}
}
Published at
2023-12-07 22:39:28Event JSON
{
"id": "4857cd7142e9560a63542d5d9184d791f52c29ee9a4a1ee4ad0dc969d61991cc",
"pubkey": "16af4cf6315d51c71ea51d7c6b747a14a200ad9ed26da544a3b4ff3726f85566",
"created_at": 1701988768,
"kind": 1,
"tags": [
[
"p",
"5150cec16f3fe453e8895cfc0a03f391c890712633f718c0bca1a1096cf8d547",
"wss://relay.mostr.pub"
],
[
"p",
"979383f8767c5d795fcad86f82dc7b38b384c1a473710c433014dc2c0fb0e359",
"wss://relay.mostr.pub"
],
[
"e",
"31f81be78a587866ebdfa93244f9c506ac97a52ee442e7a605bcbc4204ba0c79",
"wss://relay.mostr.pub",
"reply"
],
[
"proxy",
"https://mas.to/users/tshirtman/statuses/111541535952780259",
"activitypub"
]
],
"content": "nostr:npub129gvast08lj986yftn7q5qlnj8yfqufxx0m33s9u5xssjm8c64rsve4kwg but i needed that to be able to implement Ord for the type, which i needed to sort my struct using that type.\n\nI resorted to reuse a method i had built to convert each to a number of points, leveraging it to use the integer comparison.\n\nimpl PartialEq for HandTypes {\n fn eq(\u0026self, other: \u0026Self) -\u003e bool {\n self.to_num() == other.to_num()\n }\n}",
"sig": "dc11fb0a3614fbe4541de1b3a422bba57dea11fc85199393ac7f74e7af8b069ec2f9a5ba6a2084e84ef4d7096abd93c5cc4c37382980548af7f23e9fabeeb415"
}