Skip to content

Make ArrayViewMut::into_view public to allow lifetime preservation during conversion#1600

Open
at264939-ctrl wants to merge 1 commit into
rust-ndarray:masterfrom
at264939-ctrl:fix-1595-public-into-view
Open

Make ArrayViewMut::into_view public to allow lifetime preservation during conversion#1600
at264939-ctrl wants to merge 1 commit into
rust-ndarray:masterfrom
at264939-ctrl:fix-1595-public-into-view

Conversation

@at264939-ctrl

Copy link
Copy Markdown

Fixes #1595.

Currently, ArrayViewMut lacks a public API to convert to ArrayView while preserving the lifetime 'a. This PR makes

into_view
public to allow consuming the mutable view into a shared one without lifetime truncation.

src/impl_views/conversions.rs
: Make

into_view
public

src/arraytraits.rs
: Implement From for ArrayView

tests/views.rs
: Add regression tests for struct-wrapped conversions

…st-ndarray#1595)

- Change ArrayViewMut::into_view visibility to pub
- Add From<ArrayViewMut> for ArrayView implementation
- Add regression tests in tests/views.rs
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.

ArrayViewMut::into_view() should be public

1 participant