diff --git a/core/src/swarm.rs b/core/src/swarm.rs index 5f53aa27..da333530 100644 --- a/core/src/swarm.rs +++ b/core/src/swarm.rs @@ -410,10 +410,9 @@ impl<'a> PollParameters<'a> { } /// Returns the list of the addresses nodes can use to reach us. - // TODO: should return references #[inline] - pub fn external_addresses<'b>(&'b mut self) -> impl ExactSizeIterator + 'b { - self.external_addrs.iter().cloned() + pub fn external_addresses(&self) -> impl ExactSizeIterator { + self.external_addrs.iter() } /// Returns the peer id of the local node. diff --git a/protocols/identify/src/identify.rs b/protocols/identify/src/identify.rs index 0722ba8a..fdf2ea90 100644 --- a/protocols/identify/src/identify.rs +++ b/protocols/identify/src/identify.rs @@ -148,7 +148,7 @@ where .map(|p| String::from_utf8_lossy(p).to_string()) .collect(); - let mut listen_addrs: Vec<_> = params.external_addresses().collect(); + let mut listen_addrs: Vec<_> = params.external_addresses().cloned().collect(); listen_addrs.extend(params.listened_addresses().cloned()); let send_back_info = IdentifyInfo {