From 5286020deb3fd6f80e3ae9fb00c7679ee20cd1f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Kr=C3=BCger?= Date: Tue, 28 Jan 2025 18:16:08 +0100 Subject: [PATCH] Improve `iroh-net-report/Cargo.toml` diff --- Cargo.lock | 2 -- iroh-net-report/Cargo.toml | 5 +---- iroh-net-report/src/dns.rs | 5 ++--- iroh-net-report/src/reportgen.rs | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cfb4bbd261..78fba888a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2209,8 +2209,6 @@ dependencies = [ "bytes", "cfg_aliases", "derive_more", - "futures-buffered", - "futures-lite", "hickory-resolver", "iroh-base", "iroh-metrics", diff --git a/iroh-net-report/Cargo.toml b/iroh-net-report/Cargo.toml index 22feff93af..f44339fda4 100644 --- a/iroh-net-report/Cargo.toml +++ b/iroh-net-report/Cargo.toml @@ -19,8 +19,6 @@ workspace = true anyhow = "1" bytes = "1.7" derive_more = { version = "1.0.0", features = ["display"] } -futures-buffered = "0.2.8" -futures-lite = "2.3" iroh-base = { version = "0.31.0", path = "../iroh-base", default-features = false, features = ["relay"] } iroh-metrics = { version = "0.31", default-features = false } iroh-relay = { version = "0.31", path = "../iroh-relay", default-features = false } @@ -30,7 +28,7 @@ rand = "0.8" reqwest = { version = "0.12", default-features = false, features = ["stream"] } rustls = { version = "0.23", default-features = false } thiserror = "2" -tokio = { version = "1", default-features = false, features = ["sync", "time", "macros"] } +tokio = { version = "1", default-features = false, features = ["sync", "time", "macros", "rt"] } tokio-util = { version = "0.7.12", default-features = false } tracing = "0.1" url = { version = "2.4" } @@ -41,7 +39,6 @@ hickory-resolver = "=0.25.0-alpha.4" netwatch = { version = "0.3" } portmapper = { version = "0.3", default-features = false } surge-ping = "0.8.0" -tokio = { version = "1", default-features = false, features = ["sync", "time", "macros", "rt"] } [dev-dependencies] iroh-relay = { path = "../iroh-relay", features = ["test-utils", "server"] } diff --git a/iroh-net-report/src/dns.rs b/iroh-net-report/src/dns.rs index 6c776e5304..659b6d6d3f 100644 --- a/iroh-net-report/src/dns.rs +++ b/iroh-net-report/src/dns.rs @@ -1,9 +1,8 @@ use std::{fmt::Write, net::IpAddr}; use anyhow::Result; -use futures_lite::{Future, StreamExt}; use hickory_resolver::{IntoName, TokioResolver}; -use n0_future::time; +use n0_future::{time, Future, StreamExt}; use crate::defaults::timeouts::DNS_TIMEOUT; @@ -151,7 +150,7 @@ async fn stagger_call Fut, Fut: Future>>( f: F, delays_ms: &[u64], ) -> Result { - let mut calls = futures_buffered::FuturesUnorderedBounded::new(delays_ms.len() + 1); + let mut calls = n0_future::FuturesUnorderedBounded::new(delays_ms.len() + 1); // NOTE: we add the 0 delay here to have a uniform set of futures. This is more performant than // using alternatives that allow futures of different types. for delay in std::iter::once(&0u64).chain(delays_ms) { diff --git a/iroh-net-report/src/reportgen.rs b/iroh-net-report/src/reportgen.rs index 729ec6c4bd..8ef66c34d5 100644 --- a/iroh-net-report/src/reportgen.rs +++ b/iroh-net-report/src/reportgen.rs @@ -26,7 +26,6 @@ use std::{ }; use anyhow::{anyhow, bail, Context as _, Result}; -use futures_lite::StreamExt as _; #[cfg(not(wasm_browser))] use hickory_resolver::TokioResolver as DnsResolver; use iroh_base::RelayUrl; @@ -41,6 +40,7 @@ use iroh_relay::{ use n0_future::{ task::{self, AbortOnDropHandle, JoinSet}, time::{self, Duration, Instant}, + StreamExt as _, }; #[cfg(not(wasm_browser))] use netwatch::{interfaces, UdpSocket};