Rename as_type

This commit is contained in:
Austen Adler 2023-03-25 00:41:48 -04:00
parent 67cf26202d
commit f8d84b1702
2 changed files with 2 additions and 3 deletions

View File

@ -96,8 +96,7 @@ impl Coordinate {
)(i)
}
// TODO: Make this `&self`
pub fn as_type(&self, coordinate_type: &CoordinateType) -> Result<Self, Error> {
pub fn try_as_type(&self, coordinate_type: &CoordinateType) -> Result<Self, Error> {
let lat_lon = LatLon::from(self);
Ok(match coordinate_type {

View File

@ -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())
}