wireguard-uapi-rs icon indicating copy to clipboard operation
wireguard-uapi-rs copied to clipboard

Add key type to replace naked arrays

Open ernestask opened this issue 2 years ago • 4 comments

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.

ernestask avatar Jun 02 '22 14:06 ernestask

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?

gluxon avatar Jun 04 '22 20:06 gluxon

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).

ernestask avatar Jun 05 '22 05:06 ernestask

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.

gluxon avatar Jun 11 '22 18:06 gluxon

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

ernestask avatar Jun 12 '22 05:06 ernestask