Add From<&[T;N]> and From<&mut [T; N]> impls for &[mut] GenericArray #104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds the following impls to
GenericArray
:impl From<&'a [T; N]> for &'a GenericArray<T, N>
impl From<&'a mut [T; N]> for &'a mut GenericArray<T, N>
So far users had to convert their
&'a [mut] [T; N]
array references into slices to perform the conversion into theGenericArray
reference. This also resulted into an additional unnecessary assertion since the length are known anyways.This PR adds the missing
From
implementations to drop the unnecessary assertion in those cases and to allow direct conversions between array references and generic array references.