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

Convert trait type parameters to associated types #246

Merged
merged 8 commits into from
Nov 7, 2015

Conversation

brendanzab
Copy link
Collaborator

rust-lang/rust#24092 has caused quite a bit of ugliness, but I've tried to work around it as best I can.

@brendanzab
Copy link
Collaborator Author

cc @csherratt @kvark - does this look ok?

@kvark
Copy link
Collaborator

kvark commented Nov 4, 2015

Could you explain a bit on why you are doing it?

@@ -27,24 +27,24 @@ use vector::*;
/// A trait representing an [affine
/// transformation](https://en.wikipedia.org/wiki/Affine_transformation) that
/// can be applied to points or vectors. An affine transformation is one which
pub trait Transform<S: BaseNum, V: Vector<S>, P: Point<S, V>>: Sized {
pub trait Transform<P: Point>: Sized {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sweet

@kvark
Copy link
Collaborator

kvark commented Nov 4, 2015

Looked through it, looks nice.

@brendanzab
Copy link
Collaborator Author

This part of the Rust Book is good: https://doc.rust-lang.org/book/associated-types.html

@brendanzab
Copy link
Collaborator Author

Ok, I'm going to merge this.

brendanzab added a commit that referenced this pull request Nov 7, 2015
Convert trait type parameters to associated types
@brendanzab brendanzab merged commit d784e4e into master Nov 7, 2015
@brendanzab brendanzab deleted the associated-types branch November 7, 2015 22:45
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.

2 participants