Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upProvide `approx_eq` and implement `ApproxEq` for Transform2D and Transform3D #409
Conversation
|
Thanks. Instead of removing the non trait implementation of approx_eq, please keep them and have the trait implementations call them. This way you don't need to import the traits which I prefer, and it doesn't cause a breaking change. More generally we avoid making semver breaking changes in euclid unless there is a strong motivation. |
|
It's going to be a bit inconsistent because other types just implement the trait. It is likely that in real code it will already be imported. From this point of view it is soft breaking change. And anyway right now I preparing some PRs with other soft breaking changes, but their improve consistency with rust ecosystem, so I'll wait while I finish it and then maybe you change your opinion. |
|
The inconsistency can be addressed backward-compatbly the other way around, having other types implement approx_eq as a method in addition to exposing it through the trait.
I am sorry but these will have to wait potentially for a long time. Aesthetic concerns are not strong enough reasons to make semver breaking changes to euclid. If you want changes to land soon, I would suggest focusing on non breaking ones. It's still OK for you to propose some breaking changes as long as you don't mind waiting. |
|
|
|
All review comments addressed. Now Transforms implement trait additionally to their methods |
|
Please don't reformat the code. Looks good otherwise. |
…sform3D
This is not a whim, but a means of avoiding typos when writing code in repetitive data. In addition, such a style is already used elsewhere, so I do not understand why it should not be improved in the remaining ones. But if you're against... I reverted format changes |
|
Thanks for reverting the reformatting. Whether this or that style is an improvement over another is a very subjective thing. When it comes to subjective topics, its best to leave let the maintainer of the code decide. It's OK to argue about it as long as you don't pour your heart and soul into it, it's not a good use of your time and energy. I'll do a formatting pass over the code and address inconsistencies to settle the matter once we are done with incoming pull requests to avoid generating code conflicts. @bors-servo r+ |
|
|
|
|
Mingun commentedMar 13, 2020
Other geometry primitives implements that trait, so for consistency I implement it for Transform objects too.
This is small breaking change in
Transform2DandTransform3D-- now you must importapproxeq::ApproxEqif you want to compare transforms approximately.