mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-20 13:26:34 +00:00
Fix concerns
This commit is contained in:
@ -88,7 +88,10 @@ fn main() {
|
||||
// We use it to listen on the address.
|
||||
let (listener, address) = transport
|
||||
.listen_on(swarm::Multiaddr::new(&listen_addr).expect("invalid multiaddr"))
|
||||
.unwrap_or_else(|_| panic!("unsupported multiaddr protocol ; should never happen"));
|
||||
// If the multiaddr protocol exists but is not supported, then we get an error containing
|
||||
// the transport and the original multiaddress. Therefore we cannot directly use `unwrap()`
|
||||
// or `expect()`, but have to add a `map_err()` beforehand.
|
||||
.map_err(|(_, addr)| addr).expect("unsupported multiaddr");
|
||||
println!("Now listening on {:?}", address);
|
||||
|
||||
let future = listener
|
||||
|
Reference in New Issue
Block a user