From ed6c5873824679806825f1a23cae607b9d42f6f0 Mon Sep 17 00:00:00 2001 From: Kaan Barmore-Genc Date: Wed, 1 Feb 2023 00:13:29 -0500 Subject: [PATCH] Concurrently get ipv4 and ipv6 addresses --- src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2ef268b..58eafee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,8 +43,7 @@ pub struct APIPayload { async fn run(base_url: &str, ip_source: &Box, conf: &Config) -> anyhow::Result<()> { config::validate_config(conf).die_with(|error| format!("Invalid config: {}", error)); println!("Finding out the IP address..."); - let ipv4_result = ip_source.get_ipv4().await; - let ipv6_result = ip_source.get_ipv6().await; + let (ipv4_result, ipv6_result) = join!(ip_source.get_ipv4(), ip_source.get_ipv6()); let ipv4 = ipv4_result.as_ref(); let ipv6 = ipv6_result.as_ref(); println!("Found these:");