Closed progval closed 3 years ago
Sounds good.
Old issue but I might be able to help here, if this hasn’t been handled yet. :)
@deg4uss3r I don't think this has been handled yet, but you might want to look at #25 first which changes a lot of things around
Cool! I’ll hold off until that’s merged in.
If this is wanted I can easily add change the final Ok(self.clone())
line in the decapsulate
method of my PR to Err(…)
. I only thought that it may break backcompat, so I didn't do that yet.
Closing here since decapsule
has been removed in https://github.com/multiformats/rust-multiaddr/pull/40 in favor of basic iteration. Please speak up in case you would like to continue the discussion.
The doc of
decapsulate
currently reads: “Returns the original if the passed in address is not found”.Could you change the behavior of
decapsulate
to return an error of the protocol is not found? This way we have a way to know the protocol was not in the multiaddr. Additionally, it forces users ofdecapsulate
to explicitly handle this case when calling it.