swarm: return references from external_addresses (#1008)

This commit is contained in:
Fedor Sakharov
2019-03-19 17:23:58 +03:00
committed by Pierre Krieger
parent 9575fa6c08
commit 63e9e39538
2 changed files with 3 additions and 4 deletions

View File

@ -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<Item = Multiaddr> + 'b {
self.external_addrs.iter().cloned()
pub fn external_addresses(&self) -> impl ExactSizeIterator<Item = &Multiaddr> {
self.external_addrs.iter()
}
/// Returns the peer id of the local node.