We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a17b61e commit 6edd6dcCopy full SHA for 6edd6dc
iroh-relay/src/relay_map.rs
@@ -112,11 +112,14 @@ impl RelayMap {
112
self.relays.write().expect("poisoned").remove(url)
113
}
114
115
- /// Extends this `RelayMap` with another one.
116
- pub fn extend(&self, other: &RelayMap) {
117
- let mut a = self.relays.write().expect("poisoned");
118
- let b = other.relays.read().expect("poisoned");
119
- a.extend(b.iter().map(|(a, b)| (a.clone(), b.clone())));
+ /// Joins this `RelayMap` with another one into a new one
+ pub fn join(self, other: RelayMap) -> RelayMap {
+ {
+ let mut a = self.relays.write().expect("poisoned");
+ let b = other.relays.read().expect("poisoned");
120
+ a.extend(b.iter().map(|(a, b)| (a.clone(), b.clone())));
121
+ }
122
+ self
123
124
125
0 commit comments