-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hybrid-array: reference conversion support
Adds a set of reference conversions to `Array<T, U>` as well as the `ArrayOps` trait: - `&Array<T, U>`: `From<&[T, N]>` + TryFrom<&[T]> - `&mut Array<T, U>`: `From<&mut [T, N]>` + `TryFrom<&mut [T]>` The implementation uses an unsafe pointer cast to convert a slice into the corresponding reference newtype. Additionally it adds the following panicking inherent methods to `Array<T, U>` to ease migrating code based on `GenericArray`: - `Array::ref_from_slice`: alternative to `GenericArray::from_slice` - `Array::ref_from_mut_slice`: alternative to `GenericArray::from_mut_slice` - `Array::clone_from_slice`: alternative to `GenericArray::clone_from_slice` These methods are marked with TODOs to deprecate them before a final v0.2.0 release, however for now they're not deprecate to ease a migration.
- Loading branch information
Showing
1 changed file
with
119 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters