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

Document Polygon struct parameters #68

Merged
4 commits merged into from
Oct 16, 2016

Conversation

mbattifarano
Copy link
Member

@mbattifarano mbattifarano commented Oct 9, 2016

Addresses #60

Replaces the Polygon tuple struct with a regular struct:

pub struct Polygon<T>
    where T: Float
{
    pub exterior: LineString<T>,
    pub interiors: Vec<LineString<T>>
}

I'm new to rust and eager to learn so comment away!

This breaks the existing Polygon constructor since (correct me if
I'm wrong) structs must be instaniated with curly braces and named
arguments. To mitigate the effect of this change on existing code,
Polygon implements a new method that preserves the old interface:

Polygon::new(exterior, interiors)

I chose exterior and interiors over outer and inners as I
believe the former pair is more commonly used. I don't feel strongly
about this choice and will change it upon request.

Addresses georust#60

Replaces the Polygon tuple struct with a regular struct:

```
pub struct Polygon<T>
    where T: Float
{
    pub exterior: LineString<T>,
    pub interiors: Vec<LineString<T>>
}
```

I'm new to rust and eager to learn so comment away!

This breaks the existing Polygon constructor since (correct me if
I'm wrong) structs must be instaniated with curly braces and named
arguments. To mitigate the effect of this change on existing code,
`Polygon` implements a `new` method that preserve the old interface:

`Polygon::new(exterior, interiors)`

I choose `exterior` and `interiors` over `outer` and `inners` as I
believe the former pair is more commonly used. I don't feel strongly
about this choice and will change it upon request.
@notriddle
Copy link

notriddle commented Oct 9, 2016

As you can see in the little Travis CI section at the bottom, one of the tests failed. You forgot to update one of the examples in the documentation, I think.

@mbattifarano
Copy link
Member Author

Thanks @notriddle! I left out an import, just pushed the fix.

@frewsxcv
Copy link
Member

This looks good, but I'm going to leave this open until I/we push a new major version release that includes breaking changes like these. Thanks for doing this @mbattifarano! 🎊

@frewsxcv
Copy link
Member

@aelita-mergebot r+

ghost pushed a commit that referenced this pull request Oct 16, 2016
Merge #68 a=@mbattifarano r=@frewsxcv
________________________________________________________________________

Addresses #60

Replaces the Polygon tuple struct with a regular struct:

```
pub struct Polygon<T>
    where T: Float
{
    pub exterior: LineString<T>,
    pub interiors: Vec<LineString<T>>
}
```

I'm new to rust and eager to learn so comment away!

This breaks the existing Polygon constructor since (correct me if
I'm wrong) structs must be instaniated with curly braces and named
arguments. To mitigate the effect of this change on existing code,
`Polygon` implements a `new` method that preserves the old interface:

`Polygon::new(exterior, interiors)`

I chose `exterior` and `interiors` over `outer` and `inners` as I
believe the former pair is more commonly used. I don't feel strongly
about this choice and will change it upon request.
@frewsxcv
Copy link
Member

No reason to hold this up any longer. Thanks again @mbattifarano!

@ghost
Copy link

ghost commented Oct 16, 2016

👎 Build failed

@frewsxcv
Copy link
Member

Looks like there are a few more places the new Polygon needs to be used.

@mbattifarano
Copy link
Member Author

Yep, I just needed to update the additions from #70 and #71

@frewsxcv
Copy link
Member

@aelita-mergebot r+

ghost pushed a commit that referenced this pull request Oct 16, 2016
Merge #68 a=@mbattifarano r=@frewsxcv
________________________________________________________________________

Addresses #60

Replaces the Polygon tuple struct with a regular struct:

```
pub struct Polygon<T>
    where T: Float
{
    pub exterior: LineString<T>,
    pub interiors: Vec<LineString<T>>
}
```

I'm new to rust and eager to learn so comment away!

This breaks the existing Polygon constructor since (correct me if
I'm wrong) structs must be instaniated with curly braces and named
arguments. To mitigate the effect of this change on existing code,
`Polygon` implements a `new` method that preserves the old interface:

`Polygon::new(exterior, interiors)`

I chose `exterior` and `interiors` over `outer` and `inners` as I
believe the former pair is more commonly used. I don't feel strongly
about this choice and will change it upon request.
@ghost
Copy link

ghost commented Oct 16, 2016

👍 Build succeeded

@ghost ghost merged commit 8161044 into georust:master Oct 16, 2016
@mbattifarano mbattifarano deleted the polygon-named-parameters branch October 17, 2016 02:17
This pull request was closed.
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

3 participants