-
Notifications
You must be signed in to change notification settings - Fork 314
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
Support zero-length axis
in .map_axis/_mut()
#579
Comments
Hi @jturner314 . I can work on this one if you don't mind. |
@andrei-papou Sure, please feel free. |
@jturner314 could you please point me to an example of creating an empty array? Thanks a lot. |
The simplest way to create a 1-dimensional, zero-length view in Edit: If that doesn't compile, you might need a cast: |
@jturner314 thanks. please take a look at the PR #612 |
Fwiw, I realized that a cleaner (safe) way to create a zero-length one-dimensional view is |
PR was merged. Is anything still remaining here, or can this issue be closed? |
Fixed by #612. Thanks for following up. |
The implementation of
.map_axis/_mut()
panics when the specifiedaxis
is zero-length. Ideally, we'd just applymapping
to empty views instead.Example:
The text was updated successfully, but these errors were encountered: