diff --git a/Cargo.lock b/Cargo.lock index 502a19b..87ebd4c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,7 +34,7 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "s2json" -version = "1.3.0" +version = "1.4.0" dependencies = [ "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index e591443..789161c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "s2json" -version = "1.3.0" +version = "1.4.0" edition = "2021" authors = ["Craig O'Connor "] description = "This library supports the S2JSON 1.0 Specification" diff --git a/cobertura.xml b/cobertura.xml deleted file mode 100644 index 7803767..0000000 --- a/cobertura.xml +++ /dev/null @@ -1 +0,0 @@ -/Users/craigoconnor/Documents/Projects/OpenS2/s2json \ No newline at end of file diff --git a/rust/geometry.rs b/rust/geometry.rs index f28d197..3bf4ed8 100644 --- a/rust/geometry.rs +++ b/rust/geometry.rs @@ -42,7 +42,6 @@ where seq.end() } } - impl<'de, T> Deserialize<'de> for BBox where T: Deserialize<'de> + Copy, @@ -122,7 +121,6 @@ where seq.end() } } - impl<'de, T> Deserialize<'de> for BBox3D where T: Deserialize<'de> + Copy, diff --git a/rust/values.rs b/rust/values.rs index 24bcbff..a7133c4 100644 --- a/rust/values.rs +++ b/rust/values.rs @@ -47,15 +47,15 @@ pub enum ValueType { /// An array of values Array(Vec), /// A nested object - Nested(Shape), + Nested(Value), } /// Shape design -pub type Shape = BTreeMap; +pub type Value = BTreeMap; /// Shape of a features properties object -pub type Properties = Shape; +pub type Properties = Value; /// Shape of a feature's M-Values object -pub type MValue = Shape; +pub type MValue = Value; /// LineString Properties Shape pub type LineStringMValues = Vec; @@ -168,17 +168,17 @@ mod tests { } #[test] - fn shape_serialize() { - let shape: Shape = BTreeMap::from([ + fn value_serialize() { + let value: Value = BTreeMap::from([ ("type".into(), ValueType::Primitive(PrimitiveValue::String("Point".into()))), ("coordinates".into(), ValueType::Primitive(PrimitiveValue::F32(1.0))), ]); - let serialized = serde_json::to_string(&shape).unwrap(); + let serialized = serde_json::to_string(&value).unwrap(); assert_eq!(serialized, "{\"coordinates\":1.0,\"type\":\"Point\"}"); - let deserialize = serde_json::from_str::(&serialized).unwrap(); - assert_eq!(deserialize, shape); + let deserialize = serde_json::from_str::(&serialized).unwrap(); + assert_eq!(deserialize, value); - let shape_str = r#" + let value_str = r#" { "class": "ocean", "offset": 22, @@ -189,7 +189,7 @@ mod tests { } "#; - let deserialize = serde_json::from_str::(shape_str).unwrap(); + let deserialize = serde_json::from_str::(value_str).unwrap(); assert_eq!(deserialize, BTreeMap::from([ ("class".into(), ValueType::Primitive(PrimitiveValue::String("ocean".into()))), ("offset".into(), ValueType::Primitive(PrimitiveValue::U64(22))),