From 3efee2de218a6295e7cd7739e8b0d989a6836b3d Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Mon, 6 May 2024 16:56:43 +0200 Subject: [PATCH] fix(iroh-net): remove dead code --- iroh-net/src/net/interfaces.rs | 6 ------ iroh-net/src/net/interfaces/bsd.rs | 2 -- iroh-net/src/net/interfaces/linux.rs | 6 ------ iroh-net/src/net/interfaces/windows.rs | 2 -- 4 files changed, 16 deletions(-) diff --git a/iroh-net/src/net/interfaces.rs b/iroh-net/src/net/interfaces.rs index 9595774380..23964b7896 100644 --- a/iroh-net/src/net/interfaces.rs +++ b/iroh-net/src/net/interfaces.rs @@ -326,12 +326,6 @@ pub struct DefaultRouteDetails { /// The interface name. /// It's like "eth0" (Linux), "Ethernet 2" (Windows), "en0" (macOS). pub interface_name: String, - - /// Ppopulated on Windows at least. Longer description of the interface. - pub interface_description: Option, - - /// The index of the interface, `0` means not populated. - pub interface_index: u32, } impl DefaultRouteDetails { diff --git a/iroh-net/src/net/interfaces/bsd.rs b/iroh-net/src/net/interfaces/bsd.rs index d27912d514..51c3f67728 100644 --- a/iroh-net/src/net/interfaces/bsd.rs +++ b/iroh-net/src/net/interfaces/bsd.rs @@ -21,9 +21,7 @@ pub async fn default_route() -> Option { let iface = interfaces.into_iter().find(|i| i.index == idx)?; Some(DefaultRouteDetails { - interface_index: idx, interface_name: iface.name, - interface_description: None, }) } diff --git a/iroh-net/src/net/interfaces/linux.rs b/iroh-net/src/net/interfaces/linux.rs index de15895d15..2dcac775a6 100644 --- a/iroh-net/src/net/interfaces/linux.rs +++ b/iroh-net/src/net/interfaces/linux.rs @@ -57,8 +57,6 @@ async fn default_route_proc() -> Result> { if destination == ZERO_ADDR && mask == ZERO_ADDR { return Ok(Some(DefaultRouteDetails { interface_name: iface.to_string(), - interface_description: Default::default(), - interface_index: Default::default(), })); } } @@ -81,8 +79,6 @@ pub async fn default_route_android_ip_route() -> Result Result> { task.await.ok(); Ok(default.map(|(name, index)| DefaultRouteDetails { interface_name: name, - interface_description: None, - interface_index: index, })) } diff --git a/iroh-net/src/net/interfaces/windows.rs b/iroh-net/src/net/interfaces/windows.rs index cfbccf7f41..62524eaec8 100644 --- a/iroh-net/src/net/interfaces/windows.rs +++ b/iroh-net/src/net/interfaces/windows.rs @@ -29,9 +29,7 @@ fn get_default_route() -> anyhow::Result { let idx = route.InterfaceIndex.try_into()?; Ok(DefaultRouteDetails { - interface_index: idx, interface_name: route.Name, - interface_description: Some(route.Description), }) }