Skip to content

feat: add rkyv and bytecheck features with a combined rkyv-full#168

Merged
novacrazy merged 1 commit into
fizyk20:masterfrom
Enduriel:master
May 29, 2026
Merged

feat: add rkyv and bytecheck features with a combined rkyv-full#168
novacrazy merged 1 commit into
fizyk20:masterfrom
Enduriel:master

Conversation

@Enduriel
Copy link
Copy Markdown
Contributor

Thank you for this really useful crate, has made it possible for me to work around the current 'state' of Const Generics in Rust.

rkyv is a really cool zero copy serialization/deserialization crate with ~110 million downloads, and it would be really nice to have GenericArray have direct support for it rather than having to wrap it downstream with a wrapper and potentially incorrect implementations

The implementations are 1:1 copies of the respective impls for [T; N]. For rkyv they are taken from here, and for bytecheck they are taken from here.

The reason this is a single commit is that these two are almost always going to be used together, but the crates are distinct, and the joint dependency shouldn't be enforced.

Let me know if you have any feedback or suggestions on what to improve.

@Enduriel Enduriel force-pushed the master branch 2 times, most recently from 6d2405c to 7a5e076 Compare May 28, 2026 11:02
@Enduriel Enduriel marked this pull request as ready for review May 28, 2026 11:03
@novacrazy
Copy link
Copy Markdown
Collaborator

Ah, good, I tried this back in rkyv-0.7 and was unhappy with it, but 0.8 is much cleaner. The copy optimization helps a lot.

Only two things I'd like to change. Add the version number to the crate features, like rkyv-08. Also to fix that test. The force push is what seems to have broken it, missing U3 import.

@Enduriel
Copy link
Copy Markdown
Contributor Author

Sorry about the failing import, I was getting a clippy lint about the unused import and just deleted it, not thinking about the fact that it was probably used in a cfged out test.

And it makes sense to have the dependency be version specific, I hope I won't have to be back here at some point to make another PR but for a crate as used as GenericArray better safe than sorry (and from what I can tell you've had your own issues with the 0.14 situation).

Thanks for being open to this!

@novacrazy
Copy link
Copy Markdown
Collaborator

I’ll merge this in the morning. Implementation looks good.

@novacrazy novacrazy merged commit e7e155e into fizyk20:master May 29, 2026
2 checks passed
@novacrazy
Copy link
Copy Markdown
Collaborator

Published in 1.4.2. Thanks!

@Enduriel
Copy link
Copy Markdown
Contributor Author

Awesome! ty for the quick merge and release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants