Make the SwarmEvent report everything (#1515)

* Improve the SwarmEvent to report everything

* Address review

* Update swarm/src/lib.rs

Co-Authored-By: Roman Borschel <romanb@users.noreply.github.com>

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
This commit is contained in:
Pierre Krieger
2020-03-26 18:02:37 +01:00
committed by GitHub
parent 28ea62d1a9
commit 7220877a5c
5 changed files with 184 additions and 55 deletions

View File

@ -52,6 +52,7 @@ use fnv::{FnvHashMap};
use futures::{prelude::*, future};
use std::{
collections::hash_map,
convert::TryFrom as _,
error,
fmt,
hash::Hash,
@ -517,7 +518,7 @@ where
// A pending outgoing connection to a known peer failed.
let mut attempt = dialing.remove(&peer_id).expect("by (1)");
let num_remain = attempt.next.len();
let num_remain = u32::try_from(attempt.next.len()).unwrap();
let failed_addr = attempt.current.clone();
let opts =