What is Nostr?
KernelKind
npub1fgz…jeck
2024-11-05 18:25:05
in reply to nevent1q…6d4p

KernelKind on Nostr: u would have to do value.0 to access the first element and value.1 to access the ...

u would have to do value.0 to access the first element and value.1 to access the second element. that doesn’t really tell you anything. much better would be:

struct KeyWithPayload<'a> {
key: u8,
payload: &'a [u8],
}

value: KeyWithPayload

now you can do value.key to know you’re accessing the “key” and value.payload to access the “payload”. much easier to work with as a human dev
Author Public Key
npub1fgz3pungsr2quse0fpjuk4c5m8fuyqx2d6a3ddqc4ek92h6hf9ns0mjeck