Skip to content

Commit fab3c91

Browse files
Revert "switch to 'static"
This reverts commit b6547ea.
1 parent 096a656 commit fab3c91

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

iroh/src/discovery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ impl DiscoverySubscribers {
699699
}
700700
}
701701

702-
pub(crate) fn subscribe(&self) -> impl Stream<Item = Result<DiscoveryItem, Lagged>> + 'static {
702+
pub(crate) fn subscribe(&self) -> impl Stream<Item = Result<DiscoveryItem, Lagged>> + use<> {
703703
use tokio_stream::wrappers::{BroadcastStream, errors::BroadcastStreamRecvError};
704704
let recv = self.inner.subscribe();
705705
BroadcastStream::new(recv).map_err(|BroadcastStreamRecvError::Lagged(n)| Lagged { val: n })

iroh/src/endpoint.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ impl Endpoint {
911911
/// # }
912912
/// ```
913913
#[cfg(not(wasm_browser))]
914-
pub fn node_addr(&self) -> impl n0_watcher::Watcher<Value = Option<NodeAddr>> + 'static {
914+
pub fn node_addr(&self) -> impl n0_watcher::Watcher<Value = Option<NodeAddr>> + use<> {
915915
let watch_addrs = self.direct_addresses();
916916
let watch_relay = self.home_relay();
917917
let node_id = self.node_id();
@@ -976,7 +976,7 @@ impl Endpoint {
976976
/// let _relay_url = mep.home_relay().initialized().await.unwrap();
977977
/// # });
978978
/// ```
979-
pub fn home_relay(&self) -> impl n0_watcher::Watcher<Value = Vec<RelayUrl>> + 'static {
979+
pub fn home_relay(&self) -> impl n0_watcher::Watcher<Value = Vec<RelayUrl>> + use<> {
980980
self.msock.home_relay()
981981
}
982982

@@ -1046,7 +1046,7 @@ impl Endpoint {
10461046
/// # });
10471047
/// ```
10481048
#[doc(hidden)]
1049-
pub fn net_report(&self) -> impl Watcher<Value = Option<Report>> + 'static {
1049+
pub fn net_report(&self) -> impl Watcher<Value = Option<Report>> + use<> {
10501050
self.msock.net_report()
10511051
}
10521052

@@ -1089,7 +1089,7 @@ impl Endpoint {
10891089
/// connection was ever made or is even possible.
10901090
///
10911091
/// See also [`Endpoint::remote_info`] to only retrieve information about a single node.
1092-
pub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo> + 'static {
1092+
pub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo> + use<> {
10931093
self.msock.list_remote_infos().into_iter()
10941094
}
10951095

@@ -1117,7 +1117,7 @@ impl Endpoint {
11171117
///
11181118
/// [`MdnsDiscovery`]: crate::discovery::mdns::MdnsDiscovery
11191119
/// [`StaticProvider`]: crate::discovery::static_provider::StaticProvider
1120-
pub fn discovery_stream(&self) -> impl Stream<Item = Result<DiscoveryItem, Lagged>> + 'static {
1120+
pub fn discovery_stream(&self) -> impl Stream<Item = Result<DiscoveryItem, Lagged>> + use<> {
11211121
self.msock.discovery_subscribers().subscribe()
11221122
}
11231123

iroh/src/magicsock.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ impl MagicSock {
276276
&self.ip_bind_addrs
277277
}
278278

279-
fn ip_local_addrs(&self) -> impl Iterator<Item = SocketAddr> + 'static {
279+
fn ip_local_addrs(&self) -> impl Iterator<Item = SocketAddr> + use<> {
280280
self.local_addr()
281281
.into_iter()
282282
.filter_map(|addr| addr.into_socket_addr())
@@ -332,7 +332,7 @@ impl MagicSock {
332332
///
333333
/// [`Watcher`]: n0_watcher::Watcher
334334
/// [`Watcher::initialized`]: n0_watcher::Watcher::initialized
335-
pub(crate) fn net_report(&self) -> impl Watcher<Value = Option<Report>> + 'static {
335+
pub(crate) fn net_report(&self) -> impl Watcher<Value = Option<Report>> + use<> {
336336
self.net_report
337337
.watch()
338338
.map(|(r, _)| r)
@@ -343,7 +343,7 @@ impl MagicSock {
343343
///
344344
/// Note that this can be used to wait for the initial home relay to be known using
345345
/// [`Watcher::initialized`].
346-
pub(crate) fn home_relay(&self) -> impl Watcher<Value = Vec<RelayUrl>> + 'static {
346+
pub(crate) fn home_relay(&self) -> impl Watcher<Value = Vec<RelayUrl>> + use<> {
347347
let res = self.local_addrs_watch.clone().map(|addrs| {
348348
addrs
349349
.into_iter()

iroh/src/magicsock/transports/relay/actor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ impl ActiveRelayActor {
492492
/// connections. It currently does not ever return `Err` as the retries continue
493493
/// forever.
494494
// This is using `impl Future` to return a future without a reference to self.
495-
fn dial_relay(&self) -> impl Future<Output = Result<Client, DialError>> + 'static {
495+
fn dial_relay(&self) -> impl Future<Output = Result<Client, DialError>> + use<> {
496496
let client_builder = self.relay_client_builder.clone();
497497
async move {
498498
match time::timeout(CONNECT_TIMEOUT, client_builder.connect()).await {
@@ -967,7 +967,7 @@ impl RelayActor {
967967
async fn try_send_datagram(
968968
&mut self,
969969
item: RelaySendItem,
970-
) -> Option<impl Future<Output = ()> + 'static> {
970+
) -> Option<impl Future<Output = ()> + use<>> {
971971
let url = item.url.clone();
972972
let handle = self
973973
.active_relay_handle_for_node(&item.url, &item.remote_node)
@@ -1202,7 +1202,7 @@ impl RelayActor {
12021202
});
12031203
}
12041204

1205-
fn active_relay_sorted(&self) -> impl Iterator<Item = RelayUrl> + 'static {
1205+
fn active_relay_sorted(&self) -> impl Iterator<Item = RelayUrl> + use<> {
12061206
let mut ids: Vec<_> = self.active_relays.keys().cloned().collect();
12071207
ids.sort();
12081208

iroh/src/net_report.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl QadConns {
160160
reports
161161
}
162162

163-
fn watch_v4(&self) -> impl n0_future::Stream<Item = Option<QadProbeReport>> + Unpin + 'static {
163+
fn watch_v4(&self) -> impl n0_future::Stream<Item = Option<QadProbeReport>> + Unpin + use<> {
164164
let watcher = self.v4.as_ref().map(|(_url, conn)| conn.observer.watch());
165165

166166
if let Some(watcher) = watcher {
@@ -170,7 +170,7 @@ impl QadConns {
170170
}
171171
}
172172

173-
fn watch_v6(&self) -> impl n0_future::Stream<Item = Option<QadProbeReport>> + Unpin + 'static {
173+
fn watch_v6(&self) -> impl n0_future::Stream<Item = Option<QadProbeReport>> + Unpin + use<> {
174174
let watcher = self.v6.as_ref().map(|(_url, conn)| conn.observer.watch());
175175
if let Some(watcher) = watcher {
176176
watcher.stream_updates_only().boxed()

0 commit comments

Comments
 (0)