diff --git a/spatial-coordinate-systems/src/lib.rs b/spatial-coordinate-systems/src/lib.rs index 2c5071f..6391e31 100644 --- a/spatial-coordinate-systems/src/lib.rs +++ b/spatial-coordinate-systems/src/lib.rs @@ -96,8 +96,7 @@ impl Coordinate { )(i) } - // TODO: Make this `&self` - pub fn as_type(&self, coordinate_type: &CoordinateType) -> Result { + pub fn try_as_type(&self, coordinate_type: &CoordinateType) -> Result { let lat_lon = LatLon::from(self); Ok(match coordinate_type { diff --git a/xpin-wasm/src/lib.rs b/xpin-wasm/src/lib.rs index be9a6d4..fdd7908 100644 --- a/xpin-wasm/src/lib.rs +++ b/xpin-wasm/src/lib.rs @@ -66,7 +66,7 @@ impl EncodedAddress { self.src_coords // TODO: Remove the clone here .clone() - .as_type(&coordinate_type.into()) + .try_as_type(&coordinate_type.into()) .ok() .map(|s| s.to_string()) }