Skip to content

Commit

Permalink
doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Rory McCann committed Feb 13, 2019
1 parent c9b9237 commit dbf121f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions geo-types/src/geometry_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ impl<T: CoordinateType> GeometryCollection<T> {
}


/// Convert any Geometry (or anything that can be converted to a Geometry) into a
/// GeometryCollection
impl<T: CoordinateType, IG: Into<Geometry<T>>> From<IG> for GeometryCollection<T> {
fn from(x: IG) -> Self {
GeometryCollection(vec![x.into()])
}
}

/// Collect Geometries (or what can be converted to a Geometry) into a GeometryCollection
impl<T: CoordinateType, IG: Into<Geometry<T>>> FromIterator<IG> for GeometryCollection<T> {
fn from_iter<I: IntoIterator<Item = IG>>(iter: I) -> Self {
GeometryCollection(iter.into_iter().map(|g| g.into()).collect())
Expand Down

0 comments on commit dbf121f

Please sign in to comment.