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

convert 2d array to slice without trait bounds #136

Open
Lokathor opened this issue Sep 27, 2022 · 2 comments · May be fixed by #184
Open

convert 2d array to slice without trait bounds #136

Lokathor opened this issue Sep 27, 2022 · 2 comments · May be fixed by #184

Comments

@Lokathor
Copy link
Owner

right now you can convert a &[[T; N]; M] into &[T] when T is Pod, but we should add a function for this even for any generic T.

array2_as_slice or something, I dunno

@HeroicKatora
Copy link
Contributor

  • If there's no bound on T at all it doesn't sound like a very good fit for the library. Shouldn't core be able to perform this natively?
  • Which semantics to choose for &[[(); 2]; usize::MAX] (a valid ZST) which would end up with length usize::MAX*2, which overflows.

@Lokathor
Copy link
Owner Author

Shouldn't core be able to perform this natively?

core should be able to do everything in this entire crate natively, but here we are ;3

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 a pull request may close this issue.

2 participants