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

Split the Component trait into more specific traits #161

Merged
merged 1 commit into from Jan 20, 2020
Merged

Conversation

Ogeon
Copy link
Owner

@Ogeon Ogeon commented Jan 19, 2020

This adds specific traits for converting and for floating point components. This makes the implementation of each trait simpler and hopefully more efficient (@PeterHatch was right all along), and reduces their requirements a bit. A side effect is that the cast hack function can be reduced to convert from f64 values only (still not completely gone, but its use is more limited now), and become panic free. The downside is the extra FromF64 trait, but it's at least not hard to implement and new float types should be rare enough.

This is a breaking change.

@Ogeon
Copy link
Owner Author

Ogeon commented Jan 20, 2020

bors r+

bors bot added a commit that referenced this pull request Jan 20, 2020
161: Split the Component trait into more specific traits r=Ogeon a=Ogeon

This adds specific traits for converting and for floating point components. This makes the implementation of each trait simpler and hopefully more efficient (@PeterHatch was right all along), and reduces their requirements a bit. A side effect is that the `cast` hack function can be reduced to convert from `f64` values only (still not completely gone, but its use is more limited now), and become panic free. The downside is the extra `FromF64` trait, but it's at least not hard to implement and new float types should be rare enough.

This is a breaking change.

Co-authored-by: Erik Hedvall <erikwhedvall@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jan 20, 2020

Build succeeded

@bors bors bot merged commit 09043a8 into master Jan 20, 2020
@bors bors bot deleted the component_traits branch January 20, 2020 10:26
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 this pull request may close these issues.

None yet

1 participant