Closed CHr15F0x closed 3 years ago
I am leaning more towards keeping both changes. Encoding the information about peer id presence/absence in Multiaddr in type instead of relying on comments and
expect()
s improves readability and developer experience.
:+1:
I think it is even worth exploring including the change above (and thus enforcing more than just multiaddr syntax at the type level) in https://github.com/multiformats/rust-multiaddr directly.
This is a follow up of https://github.com/rs-ipfs/rust-ipfs/pull/472. There are two changes introduced:
Multiaddr
in `SwarmApi::pending{addresses, connections}` contains p2p, align conversions accordingly (https://github.com/rs-ipfs/rust-ipfs/commit/136496f7de57d72782cf4c06108733321b05e9fc),MultiaddrWithPeerId
inSwarmApi::pending_{addresses, connections}
(https://github.com/rs-ipfs/rust-ipfs/commit/3b6f69530f633a9db4545fffe4b054dc69a760fc).The former (https://github.com/rs-ipfs/rust-ipfs/commit/136496f7de57d72782cf4c06108733321b05e9fc) works fine without the latter (https://github.com/rs-ipfs/rust-ipfs/commit/3b6f69530f633a9db4545fffe4b054dc69a760fc), however I am leaning more towards keeping both changes. Encoding the information about peer id presence/absence in Multiaddr in type instead of relying on comments and
expect()
s improves readability and developer experience.Please let me know what your thoughts are.