diff --git a/Cargo.toml b/Cargo.toml index fe25e9d..44d347e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -89,7 +89,7 @@ rhai = {version="1.13", features=["only_i64", "no_index", "no_object", "no_time" stderrlog = "0.6" svg = "0.17" wkb = "0.7" -wkt = "0.10" +wkt = "0.11" [build-dependencies] cc = {version="*", features=["parallel"], optional=true} diff --git a/generative/io/wkt.rs b/generative/io/wkt.rs index 8bfbb78..0169c5a 100644 --- a/generative/io/wkt.rs +++ b/generative/io/wkt.rs @@ -149,7 +149,7 @@ where type Error = wkt::conversion::Error; fn try_from(wkt: Wkt) -> Result { - let geometry = Geometry::try_from(wkt.item)?; + let geometry = Geometry::try_from(wkt)?; Ok(geometry.into()) } } @@ -380,7 +380,7 @@ where { for geometry in geometries { let wkt_geom = geometry.to_wkt(); - writeln!(writer, "{}", wkt_geom.item).expect("Writing failed"); + writeln!(writer, "{}", wkt_geom).expect("Writing failed"); } } @@ -545,11 +545,12 @@ mod tests { } #[test] - fn test_cant_parse_3d_sad_face() { + fn test_can_parse_3d() { let wkt = b"POINT Z(1 2 3)"; - let geometries = read_wkt_geometries(&wkt[..]); + let mut geometries = read_wkt_geometries(&wkt[..]); - assert_eq!(geometries.count(), 0); + let point = geometries.next(); + assert_eq!(point, Some(Geometry::Point(Point::new(1.0, 2.0)))); } #[test]