gluxon / wireguard-uapi-rs

MIT License
31 stars 9 forks source link

Add key type to replace naked arrays #24

Open ernestask opened 2 years ago

ernestask commented 2 years ago

This commit replaces the ever so prevalent 32-large array of u8s with a tuple struct and some aliases for struct fields. Ideally, those aliases would be strongly-typed, but sharing the conversion logic from u8 slices becomes painful.

gluxon commented 2 years ago

I believe this is an API change, so we'll have to release a new major version once this merges. I saw #25 as well, but did you want to get other breaking changes in?

ernestask commented 2 years ago

I have nothing else in queue right now.

I created the PRs to see what you thought of the changes, but, now that I think of it, the API breakages can’t be avoided (and adapting existing code will be more shit work for little added benefit for most, I imagine).

gluxon commented 2 years ago

It will be a bit of shit work, but that consequence is also a bit on me for not abstracting these naked key types in the first place. 😞

There probably isn't any particularly best right time to merge this. Feel free to hit the merge button when you think is best.

ernestask commented 2 years ago

All right. I’ll integrate the changes into my code to see if I had managed to forget something and then merge.