Skip to content

Commit 400c42c

Browse files
committed
feat: future in timeout simplified
1 parent 3509cfd commit 400c42c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,7 @@ async fn create_endpoint(
356356
let endpoint = builder.bind().await?;
357357

358358
if !(common.relay == RelayModeOption::Disabled) {
359-
let _ = tokio::time::timeout(Duration::from_secs(5), async {
360-
endpoint.online().await;
361-
}).await;
359+
let _ = tokio::time::timeout(Duration::from_secs(5), endpoint.online()).await;
362360
};
363361

364362
Ok(endpoint)

0 commit comments

Comments
 (0)