Skip to content

Conversation

@jmwample
Copy link
Contributor

Implementation of as_flattened and as_flattened_mut for nested Array types to make it easier to operate on nested Arrays. Inspiration drawn from the as_flattened{_mut} implementations on [[T; N]] (i.e. for the slice primitive).

Note:

  • Array<[T; N], U> already implements these functions as it is transparent to &[[T; N]].
  • [Array<T, U>] does not implement these functions and we can't implement them this way without a new local trait. Doesn't really seem necessary though.

@tarcieri
Copy link
Member

NOTE: the SAFETY comments could probably include some more information regarding the Array type always being a newtype for a core array, similar to the existing SAFETY comments, but this is fine for now

@tarcieri tarcieri merged commit 4e4c10e into RustCrypto:master Sep 12, 2024
14 checks passed
@jmwample jmwample deleted the flatten branch September 12, 2024 17:52
@tarcieri tarcieri mentioned this pull request Oct 19, 2024
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.

2 participants