mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-28 09:11:34 +00:00
Fix panic in identify (#314)
This commit is contained in:
@ -24,6 +24,7 @@ use libp2p_core::{Multiaddr, MuxedTransport, Transport};
|
||||
use parking_lot::Mutex;
|
||||
use protocol::{IdentifyInfo, IdentifyOutput, IdentifyProtocolConfig};
|
||||
use std::collections::hash_map::Entry;
|
||||
use std::error::Error;
|
||||
use std::io::Error as IoError;
|
||||
use std::sync::Arc;
|
||||
use tokio_io::{AsyncRead, AsyncWrite};
|
||||
@ -316,7 +317,7 @@ where F: FnOnce() -> Fut,
|
||||
entry.insert(future.clone());
|
||||
future::Either::B(future)
|
||||
},
|
||||
}.map(|out| (*out).clone()).map_err(|err| panic!()) // FIXME:
|
||||
}.map(|out| (*out).clone()).map_err(|err| IoError::new(err.kind(), err.description()))
|
||||
}
|
||||
|
||||
// TODO: test that we receive back what the remote sent us
|
||||
|
Reference in New Issue
Block a user