From 7d52e50beefbe0b48025b2f99717843b27eccb99 Mon Sep 17 00:00:00 2001 From: alexanderwiederin Date: Tue, 14 Nov 2023 12:16:27 +0100 Subject: [PATCH] add `num_addresses` variable --- src/test/utils.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/utils.rs b/src/test/utils.rs index ea4297ebd..b4fd5f4f7 100644 --- a/src/test/utils.rs +++ b/src/test/utils.rs @@ -136,9 +136,10 @@ pub fn random_port() -> u16 { } pub fn random_listening_addresses() -> Vec { - let mut listening_addresses = Vec::with_capacity(2); + let num_addresses = 2; + let mut listening_addresses = Vec::with_capacity(num_addresses); - for _ in 0..2 { + for _ in 0..num_addresses { let rand_port = random_port(); let address: SocketAddress = format!("127.0.0.1:{}", rand_port).parse().unwrap(); listening_addresses.push(address);