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

Make ArrayBase::get_ptr(_mut) public to enable indexing into raw views. #1151

Merged
merged 2 commits into from Jul 30, 2022
Merged

Make ArrayBase::get_ptr(_mut) public to enable indexing into raw views. #1151

merged 2 commits into from Jul 30, 2022

Conversation

adamreichold
Copy link
Collaborator

@adamreichold adamreichold commented Jan 22, 2022

Noticed this as we would like to provide raw views into NumPy arrays when it is difficult to enforce the required aliasing guarantees for reference-based views, c.f. PyO3/rust-numpy#260 (comment)

I do wonder whether there is a reason these cannot be made public but could not find anything using Git archaeology.

@jturner314
Copy link
Member

This looks good to me, although I'd prefer to change the name get_ptr_mut to get_mut_ptr to be more consistent with the existing as_mut_ptr method.

@adamreichold
Copy link
Collaborator Author

I'd prefer to change the name get_ptr_mut to get_mut_ptr to be more consistent with the existing as_mut_ptr method.

Changed as suggested.

@jturner314 jturner314 added this to the 0.15.x milestone Jan 31, 2022
Copy link
Member

@jturner314 jturner314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I just noticed a minor unnecessary line. I've added this PR to the 0.15.x milestone.

src/impl_methods.rs Outdated Show resolved Hide resolved
@jturner314 jturner314 changed the base branch from master to 0.15.x July 30, 2022 20:14
@jturner314 jturner314 changed the base branch from 0.15.x to master July 30, 2022 20:31
@jturner314 jturner314 changed the base branch from master to 0.15.x July 30, 2022 20:32
@jturner314 jturner314 merged commit 853384a into rust-ndarray:0.15.x Jul 30, 2022
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

2 participants