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

Add associated return type for Centroid algorithm trait. #154

Merged
merged 1 commit into from
Sep 4, 2017

Conversation

frewsxcv
Copy link
Member

@frewsxcv frewsxcv commented Sep 4, 2017

No description provided.

@frewsxcv
Copy link
Member Author

frewsxcv commented Sep 4, 2017

In the future, we can remove the Option from the polygon and linestring implementations once we implement validation (I'm working on linestring validation right now in a branch).

@frewsxcv frewsxcv requested a review from urschrei September 4, 2017 18:49
@@ -6,6 +6,8 @@ use algorithm::distance::Distance;

/// Calculation of the centroid.
pub trait Centroid<T: Float> {
type Centroid;
Copy link
Member Author

Choose a reason for hiding this comment

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

i originally titled this Result, but that's confusing since there's std::result::Result which is conceptually different

Copy link
Member

@urschrei urschrei left a comment

Choose a reason for hiding this comment

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

👍

@@ -6,6 +6,8 @@ use algorithm::distance::Distance;

/// Calculation of the centroid.
pub trait Centroid<T: Float> {
type Centroid;
Copy link
Member Author

Choose a reason for hiding this comment

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

actually, maybe Output would be a better name here. i'm doing the same thing with bounding box right now and it's confusing that the trait is BoundingBox, the associated return type name is BoundingBox and the actual return type is Bbox.

@frewsxcv frewsxcv force-pushed the frewsxcv-centroid-type branch from 7a55477 to 10330f1 Compare September 4, 2017 21:02
@frewsxcv
Copy link
Member Author

frewsxcv commented Sep 4, 2017

bors r+

bors bot added a commit that referenced this pull request Sep 4, 2017
154: Add associated return type for Centroid algorithm trait. r=frewsxcv a=frewsxcv
@bors
Copy link
Contributor

bors bot commented Sep 4, 2017

Build succeeded

@bors bors bot merged commit 10330f1 into master Sep 4, 2017
@frewsxcv frewsxcv deleted the frewsxcv-centroid-type branch September 4, 2017 21:33
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