Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement CheckBytes on ArchivedOptionBox and ArchivedOptionNonZeroN, plus ArchivedOptionNonZeroN::take() #484

Merged
merged 5 commits into from
Apr 10, 2024

Conversation

novacrazy
Copy link
Contributor

As the title says.

Closes #474
Closes #368

The ArchivedOptionNonZeroN::take() is a bit extra, but I was in the file.

@novacrazy
Copy link
Contributor Author

I need to test the ArchivedOptionBox more.

@novacrazy
Copy link
Contributor Author

Is it okay to leave that test where it is or should I move it to rkyv_test?

I did have to reimplement it to bypass ArchivedBox::verify, as that fails with null pointers required for the None variant. It's a bit awkward, but should work fine.

rkyv/src/niche/option_box.rs Outdated Show resolved Hide resolved
@djkoloski
Copy link
Collaborator

Is it okay to leave that test where it is or should I move it to rkyv_test?

In the future I'd like to move the tests out of rkyv_test and back into the main codebase, so this is actually a step in the right direction.

@novacrazy
Copy link
Contributor Author

Should be good to go. You're welcome to squash this.

@djkoloski djkoloski merged commit 356684f into rkyv:main Apr 10, 2024
0 of 19 checks passed
@djkoloski
Copy link
Collaborator

Thanks for the PR! Sorry for the delay!

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.

Add API to set niched Option<NonZero*> types to None add CheckBytes impls for archived niche types
2 participants