Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flatten/unflatten functionality #151

Closed
Dzuchun opened this issue Nov 21, 2024 · 4 comments
Closed

flatten/unflatten functionality #151

Dzuchun opened this issue Nov 21, 2024 · 4 comments

Comments

@Dzuchun
Copy link

Dzuchun commented Nov 21, 2024

I wonder if there's a way to flatten/unflatten a two-dimensional array. I think that as long as dimensions are properly enforced with the bounds, it should be safe to simply cast between them, since GenericArray has the same layout as core array.

It is trivial to implement anywhere, but I feel like it should be a part of this crate.

novacrazy added a commit that referenced this issue Nov 22, 2024
@Dzuchun
Copy link
Author

Dzuchun commented Nov 23, 2024

Looks good to me!
(should we close the issue, then?)

@novacrazy
Copy link
Collaborator

I haven't published it yet, was attempting some other things while I was at it. The lack of const given it's implemented via a trait is a non-issue, then?

@Dzuchun
Copy link
Author

Dzuchun commented Nov 23, 2024

Yeah, I used const in the gist just because I could.

These methods not being const is consistent with rest of the crate, so that's ok.

@novacrazy
Copy link
Collaborator

Published in v1.1.1

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

No branches or pull requests

2 participants