Skip to content

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

Merged
akern40 merged 2 commits into
rust-ndarray:masterfrom
at264939-ctrl:fix-1595-public-into-view
Jun 19, 2026
Merged

Make ArrayViewMut::into_view public to allow lifetime preservation during conversion#1600
akern40 merged 2 commits into
rust-ndarray:masterfrom
at264939-ctrl:fix-1595-public-into-view

Conversation

@at264939-ctrl

Copy link
Copy Markdown
Contributor

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
@nilgoyette

Copy link
Copy Markdown
Collaborator

Thanks. Can you please fix the failing cicd checks?

@nilgoyette

Copy link
Copy Markdown
Collaborator

Lgtm, thanks again. I prefer to wait for the principal maintainer @akern40 to merge this. Shouldn't take too long.

@at264939-ctrl

Copy link
Copy Markdown
Contributor Author

Lgtm, thanks again. I prefer to wait for the principal maintainer @akern40 to merge this. Shouldn't take too long.

OK @nilgoyette thanks for review

@akern40 akern40 merged commit bd3ade9 into rust-ndarray:master Jun 19, 2026
15 checks passed
@akern40

akern40 commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Seems sound to me, thanks for the contribution!

@at264939-ctrl at264939-ctrl deleted the fix-1595-public-into-view branch June 19, 2026 15:19
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

3 participants