-
Notifications
You must be signed in to change notification settings - Fork 186
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
Geometrycollection ergonomics #339
Conversation
…y geometries it contains
geo-types/src/geometry_collection.rs
Outdated
@@ -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> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
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
bors r+ |
Build succeeded |
just some minor ergonomic improvements