Skip to content

Commit 9b1665a

Browse files
committed
Amend connection limit comment, use expect for handling join results
1 parent cbef6bd commit 9b1665a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ struct Cli {
116116
#[arg(short = 'd', long, default_value = DEFAULT_DEST_ADDR, value_delimiter=',')]
117117
destination_addresses: Vec<String>,
118118

119-
/// Maximum amount of allowed concurrent connections
119+
/// Maximum amount of allowed concurrent connections.
120+
/// The limit will be enforced separately for each source/destination pair.
120121
#[arg(short = 'c', long, default_value_t = 1250)]
121122
max_concurrent_connections: usize,
122123

@@ -312,5 +313,10 @@ async fn main() -> Result<()> {
312313
})
313314
})
314315
.collect::<JoinSet<_>>();
315-
join_set.join_next().await.unwrap().unwrap().unwrap()
316+
join_set
317+
.join_next()
318+
.await
319+
.expect("join set should not be empty")
320+
.expect("join result from join set should not result in join error")
321+
.expect("async task should not result in join error")
316322
}

0 commit comments

Comments
 (0)