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

Add bytes feature flag #10

Merged
merged 4 commits into from
Nov 15, 2024
Merged

Add bytes feature flag #10

merged 4 commits into from
Nov 15, 2024

Conversation

carlsverre
Copy link
Contributor

@carlsverre carlsverre commented Nov 14, 2024

This feature causes Slice to be backed by bytes::Bytes rather than Arc<[u8]>.

I copied most of the Slice implementation to keep the change simple and testable. I also added tests to ensure compatibility with all the different ways Slices are created and compared. And switched to generics for PartialOrd/PartialEq to make testing easier and the API more complete.

I've run tests on all three projects locally (with/without the feature flag) and the only other changes required are passing through the bytes feature flag, and some lint related errors in lsm-tree. Will submit PRs to both of those projects shortly.

Required for fjall-rs/fjall#94

This feature causes `Slice` to be backed by `bytes::Bytes` rather than
`Arc<[u8]>`.
src/slice/slice_arc.rs Outdated Show resolved Hide resolved
@marvin-j97 marvin-j97 merged commit 8c4db90 into fjall-rs:main Nov 15, 2024
11 checks passed
@marvin-j97
Copy link
Contributor

marvin-j97 commented Nov 15, 2024

This is missing an Into<Bytes> or into_bytes, isn't it? Otherwise it's not possible to access the Bytes

nvm found it

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