Skip to content

Commit

Permalink
impl From<ServiceId> for ServiceAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
rubdos committed Oct 18, 2024
1 parent e5507bf commit b5db289
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/service_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,19 @@ impl ServiceAddress {
}
}

impl From<ServiceId> for ServiceAddress {
fn from(service_id: ServiceId) -> Self {
match service_id {
ServiceId::Aci(service_id) => {
ServiceAddress::from_aci(service_id.into())
},
ServiceId::Pni(service_id) => {
ServiceAddress::from_pni(service_id.into())
},
}
}
}

impl TryFrom<&ProtocolAddress> for ServiceAddress {
type Error = ParseServiceAddressError;

Expand Down

0 comments on commit b5db289

Please sign in to comment.