-
Notifications
You must be signed in to change notification settings - Fork 10
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
Shortcut for the 10 AsPrimitive<T> #60
Comments
It's true that part of the reasons why the Allow me to look deeper into this later this evening. |
Sorry, I don't want to be that kind of guy, asking the same question two times, but ... we want to use ndarray 0.13 at my job, so have you looked into this problem? Or if you don't have the time to do it, can you please do a release without a fix to this issue? |
Oh no, I had forgotten to take care of this one. :S My deepest apologies, I was clearly at fault here. v0.9.0 is now released and published on crates.io. I ought to be more careful next time. |
Hey, we're all freely giving our time here, there's no compulsion! Thank you for the release! |
I wanted to finish this task before I ask you for yet another release, so I asked on users.rust-lang.org and they helped me reach a solution that I consider clean, but it requires nightly so I'll simply wait until |
I understand that the type alias could eventually be introduced without a breaking change, but it would still be unfortunate to have to depend on an unstable language feature. Maybe an alternative would be constraining our data element to a new trait similar to Please feel free to let me know if you'd like to try something like this and/or whether you need more assistance on this. I would be glad to see some progress on this issue. |
I don't want to depend on any unstable feature either. The way I see it, this task is a "nice to have", it simply makes the code more DRY. IMO, it doesn't deserve any big sacrifice of time or effort. That's why I wrote "I'll simply wait until If you believe your suggestion should be done anyway because it would make nifti-rs "better", then you should probably explain in more details what you have in mind. I'm not saying I'll code it asap but at least I'll be able to start when I have some free time at work. |
I figured that I would be probably better off to show this alternative. Please see #78 when you can. Yes, this requires some repetition at this crate, but at least it doesn't spread so many trait bounds to our public APIs, which I believe is a fair price to pay. |
You know that group of 10
AsPrimitive
that we see quite often innifti-rs
(8 times) and probably in all other projects that use nifti-rs and generics?I tried removed them, but of course I can't because it tries to read from all possible types and convert that to all possible types. This is an important requirement :)
Maybe this is more a question about Rust, but do you think that it's possible to create a "group" trait and use it everywhere? A kind of shortcut? I tested it
and tried using it but it seems that I don't know the right syntax or that's it's impossible. I get several errors that look like
It would be really nice to have this shortcut! Do you think it's possible?
The text was updated successfully, but these errors were encountered: