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

Geometrycollection ergonomics #339

Merged
merged 3 commits into from
Feb 17, 2019

Conversation

amandasaurus
Copy link
Member

just some minor ergonomic improvements

@@ -11,12 +11,33 @@ pub struct GeometryCollection<T>(pub Vec<Geometry<T>>)
where
T: CoordinateType;

impl<T: CoordinateType> GeometryCollection<T> {
/// Return an empty GeometryCollection
pub fn empty() -> GeometryCollection<T> {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pub fn empty() -> GeometryCollection<T> {
pub fn new() -> GeometryCollection<T> {

thoughts on calling this new? this matches other empty collection constructors in rust, e.g. Vec::new, HashMap::new

Copy link
Contributor

Choose a reason for hiding this comment

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

or implement Default ? even if I'm not sure it makes sense for a GeometryCollection

@frewsxcv
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Feb 17, 2019
339: Geometrycollection ergonomics r=frewsxcv a=rory

just some minor ergonomic improvements

Co-authored-by: Rory McCann <rory@technomancy.org>
Co-authored-by: Corey Farwell <coreyf@rwell.org>
@bors
Copy link
Contributor

bors bot commented Feb 17, 2019

Build succeeded

@bors bors bot merged commit 382c020 into georust:master Feb 17, 2019
@amandasaurus amandasaurus deleted the geometrycollection-ergonomics branch February 20, 2019 21:32
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