-
Notifications
You must be signed in to change notification settings - Fork 32
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
Conversion/Casts considerations #88
Comments
I think this time a PR would be appropriate (that would also allow you to test before changes are published). Some guidelines:
The point is, I'd like to avoid a situation where Methods can be added as long as they are general enough (so stuff based on In your specific project, you might find it more convenient to have "extension traits" implemented for all vector types, where you add conversion methods as you see fit (then put the trait impl into a macro re-used for all vector types). If I understood correctly it's just a matter of using |
Would you consider adding |
I think I'm OK with |
Context: I'm using
vek
in combination withfixed
point numbers. In case you are curious, the project I'm working on istwmap
(and the few other things I build on top of it).Vec2
currently hasnumcast
as its main method of conversion afaik.numcast
relies onNumcast
, whichfixed
doesn't implement (reasoning).Conversion methods which I think could be added
ToPrimitive
andFromPrimitive
(I guess alsoAsPrimitive
if you want to be thorough)From
,Into
,TryFrom
andTryInto
based conversion. I personally don't need them yet, but I can see me needing them in the future. Implementing the trait is not possible, but methods using the traits could help.az
crate has a nice set of conversion traits. These are not implemented generically and thus can be implemented.fixed
supports them, but otherwiseaz
doesn't have that many downloads.Like last time, I'm willing to put my own time into this, but I won't stop you if you judge that it's worth your time :)
I'll continue opening issues for non-trivial things, as you suggest in the README
The text was updated successfully, but these errors were encountered: