Rename as_type
This commit is contained in:
parent
67cf26202d
commit
f8d84b1702
@ -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 {
|
||||
|
@ -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())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user