Bugfix: Lazily evaluate b64 address construction after b32 try

This commit is contained in:
Philip (a-0) 2024-03-23 19:46:23 +01:00
parent 3758249a28
commit 0c2bdb2ee3

View file

@ -52,7 +52,7 @@ impl From<PeerId> for I2pSocketAddr {
impl From<I2pSocketAddr> for PeerId {
fn from(value: I2pSocketAddr) -> Self {
Self::try_from_b32(&value.dest().string(), Some(value.port())).unwrap_or(
Self::try_from_b32(&value.dest().string(), Some(value.port())).unwrap_or_else(|_|
Self::try_from_dest(&value.dest().string(), Some(value.port())).expect(&format!(
"I2pSocketAddr was neither in b32 nor in b64 format: {value:?}"
)),