From f8d84b17027ad6cf3917fd071d25959180e4bad6 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sat, 25 Mar 2023 00:41:48 -0400 Subject: [PATCH] Rename as_type --- spatial-coordinate-systems/src/lib.rs | 3 +-- xpin-wasm/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) 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()) }