From b5db2895cf24d8c65d3d7b56cc5854a655fdbea2 Mon Sep 17 00:00:00 2001 From: Ruben De Smet Date: Sat, 12 Oct 2024 14:58:02 +0200 Subject: [PATCH] impl From for ServiceAddress --- src/service_address.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/service_address.rs b/src/service_address.rs index de3c74267..d0e4f2469 100644 --- a/src/service_address.rs +++ b/src/service_address.rs @@ -87,6 +87,19 @@ impl ServiceAddress { } } +impl From 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;