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 .into_raw_vec_with_offset() and deprecate .into_raw_vec() #1379

Merged
merged 2 commits into from Apr 4, 2024

Conversation

bluss
Copy link
Member

@bluss bluss commented Apr 1, 2024

Without the offset from start of allocation to the logically first element of the array,
correctly reinterpreting the results of .into_raw_vec() as an n-D array is tricky.

Provide a smoother transition by deprecating the old method and
introducing a new one.

Return Option, this makes the empty vector case stand out
as a separate case that needs to be handled.

Closes #994 by superseding it.

Without the offset from start of allocation to the logically first
element of the array, correctly reinterpreting the results of
.into_raw_vec() as an n-D array is tricky.
@bluss bluss added this to the 0.16.0 milestone Apr 1, 2024
@bluss bluss changed the title Update into_raw_vec Add .into_raw_vec_with_offset() and deprecate .into_raw_vec() Apr 1, 2024
src/dimension/mod.rs Outdated Show resolved Hide resolved
tests/array.rs Outdated Show resolved Hide resolved
Provide a smoother transition by deprecating the old method and
introducing a new one.

Return Option<usize>, this makes the empty vector case stand out
as a separate case that needs to be handled.
@bluss bluss enabled auto-merge April 4, 2024 17:00
@bluss bluss added this pull request to the merge queue Apr 4, 2024
Merged via the queue into master with commit 510d65b Apr 4, 2024
10 checks passed
@bluss
Copy link
Member Author

bluss commented Apr 4, 2024

thanks for looking at this

@bluss bluss deleted the offset-to-first-2 branch April 4, 2024 18:06
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.

None yet

3 participants