-
Notifications
You must be signed in to change notification settings - Fork 200
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
Conversation
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.
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. |
Thanks @notriddle! I left out an import, just pushed the fix. |
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! 🎊 |
@aelita-mergebot r+ |
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.
No reason to hold this up any longer. Thanks again @mbattifarano! |
Looks like there are a few more places the new |
@aelita-mergebot r+ |
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.
Addresses #60
Replaces the Polygon tuple struct with a regular struct:
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 anew
method that preserves the old interface:Polygon::new(exterior, interiors)
I chose
exterior
andinteriors
overouter
andinners
as Ibelieve the former pair is more commonly used. I don't feel strongly
about this choice and will change it upon request.