Add back the Swarm (#613)

This commit is contained in:
Pierre Krieger
2018-11-07 19:29:07 +01:00
committed by GitHub
parent 8377a2f50d
commit c04d0fe797
5 changed files with 373 additions and 1 deletions

View File

@ -1130,7 +1130,10 @@ where
TOutEvent: Send + 'static,
{
let mut addrs = addrs.into_iter();
let first = addrs.next().unwrap(); // TODO: bad
let first = match addrs.next() {
Some(f) => f,
None => return Err(self)
};
let rest = addrs.collect();
self.connect_inner(handler, first, rest)
}