[x] I added an entry to CHANGES.md if knowledge of this change could be valuable to users.
[x] I ran cargo fmt
Draft because it's based on #89, so please review that first.update: merged!
The user benefit here is the implementation of ToWkt directly on the inner geometry enums so...
instead of:
let point: geo_types::point!(x: 1.0, y: 2.0);
let geo_geometry = geo_types::Geometry::from(point);
let string = geo_geometry.wkt_string();
assert_eq!("POINT(1 2)", string);
you can do:
let point: geo_types::point!(x: 1.0, y: 2.0);
let string = point.wkt_string();
assert_eq!("POINT(1 2)", string);
I also wanted to detangle ToWkt from geo-types, so that (hypothetical) non-geo-types users could implement it.
The majority of the lines changed are in ToWkt for non-geotypes, but it's a misleading large diff (sorry). Largely it's a cut and paste job: I cut the geo-types specific code from towkt.rs and pasted it into the new geo_types_to_wkt.rs.
For symmetry, and to better reflect it's functionality, I renamed the conversions module to geo_types_from_wkt.
CHANGES.md
if knowledge of this change could be valuable to users.[x] I ran cargo fmt
Draft because it's based on #89, so please review that first.update: merged!The user benefit here is the implementation of
ToWkt
directly on the inner geometry enums so...instead of:
you can do:
I also wanted to detangle ToWkt from geo-types, so that (hypothetical) non-geo-types users could implement it.
The majority of the lines changed are in ToWkt for non-geotypes, but it's a misleading large diff (sorry). Largely it's a cut and paste job: I cut the
geo-types
specific code fromtowkt.rs
and pasted it into the newgeo_types_to_wkt.rs
.For symmetry, and to better reflect it's functionality, I renamed the
conversions
module togeo_types_from_wkt
.