let address: Multiaddr = "/ipv4/127.0.0.1".parse().unwrap();
let wtf = Multiaddr::from_bytes(address.to_bytes()).unwrap();
panics. Same with as_slice().to_vec(). Is that expected behavior?
The docs don't really state/show how these APIs are supposed to be used, neither do any tests show that any output of the bytes*-functions of Multiaddr can be parsed by from_bytes...
Wanted to add parsing support for an external library, added a test, found that:
panics. Same with
as_slice().to_vec()
. Is that expected behavior?The docs don't really state/show how these APIs are supposed to be used, neither do any tests show that any output of the
bytes*
-functions ofMultiaddr
can be parsed byfrom_bytes
...