Skip to content

Conversation

@tarcieri
Copy link
Member

@tarcieri tarcieri commented Sep 1, 2025

Adds TryFrom impls which convert from Box/Vec.

The main impetus for this is #114 where it's noted such conversions work for [T; N] but don't work for the Array type, where we are trying to make a type which works as much like core arrays as possible.

Closes #114

Adds `TryFrom` impls which convert from `Box`/`Vec`.

The main impetus for this is #114 where it's noted such conversions work
for `[T; N]` but don't work for the `Array` type, where we are trying
to make a type which works as much like core arrays as possible.

Closes #114
@tarcieri tarcieri requested a review from newpavlov September 1, 2025 16:55
@tarcieri tarcieri merged commit 8dd8f8b into master Sep 1, 2025
14 checks passed
@tarcieri tarcieri deleted the add-box-and-vec-conversions branch September 1, 2025 18:10
tarcieri added a commit that referenced this pull request Sep 1, 2025
Gated on the `alloc` feature, added in #136

These are cooresponding changes which allow conversions the other way.

The owned conversion moves array elements into a `Box<[T]>` or `Vec<T>`.

The borrowed conversion bounds on `T: Clone` ala the upstream impls in
liballoc.
tarcieri added a commit that referenced this pull request Sep 1, 2025
Gated on the `alloc` feature, added in #136.

These are cooresponding changes which allow conversions the other way.

The owned conversion moves array elements into a `Box<[T]>` or `Vec<T>`.

The borrowed conversion bounds on `T: Clone` ala the upstream impls in
liballoc.
@tarcieri tarcieri mentioned this pull request Sep 1, 2025
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.

Array::from_slice deprecated

2 participants