Skip to content

Commit 84dd511

Browse files
authored
fix: remove unneeded lifetime bound for watcher in wasm (#3354)
## Description The return type of `Endpoint::node_addr` has a lifetime bound on `&self`, only in the wasm_browser version. I think this is an oversight, we should not have different signatures for different targets. This PR fixes it. ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist <!-- Remove any that are not relevant. --> - [x] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented. - [ ] List all breaking changes in the above "Breaking Changes" section. - [ ] Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are: - [ ] [`quic-rpc`](https://github.com/n0-computer/quic-rpc) - [ ] [`iroh-gossip`](https://github.com/n0-computer/iroh-gossip) - [ ] [`iroh-blobs`](https://github.com/n0-computer/iroh-blobs) - [ ] [`dumbpipe`](https://github.com/n0-computer/dumbpipe) - [ ] [`sendme`](https://github.com/n0-computer/sendme)
1 parent aebbc72 commit 84dd511

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

iroh/src/endpoint.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ impl Endpoint {
966966
/// with a [`NodeAddr`] that only contains a relay URL, but no direct addresses,
967967
/// as there are no APIs for directly using sockets in browsers.
968968
#[cfg(wasm_browser)]
969-
pub fn node_addr(&self) -> impl n0_watcher::Watcher<Value = Option<NodeAddr>> + '_ {
969+
pub fn node_addr(&self) -> impl n0_watcher::Watcher<Value = Option<NodeAddr>> {
970970
// In browsers, there will never be any direct addresses, so we wait
971971
// for the home relay instead. This makes the `NodeAddr` have *some* way
972972
// of connecting to us.
@@ -2475,6 +2475,7 @@ mod tests {
24752475
Ok(())
24762476
}
24772477

2478+
#[cfg_attr(windows, ignore = "flaky")]
24782479
#[tokio::test]
24792480
#[traced_test]
24802481
async fn endpoint_relay_connect_loop() -> Result {

0 commit comments

Comments
 (0)