Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Commit f712acd

Browse files
committed
Correct way to run the executor
1 parent 7edc81d commit f712acd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ fn test_mqtt_client() -> Result<EspMqttClient<'static, ConnState<MessageImpl, Es
704704

705705
#[cfg(not(esp_idf_version = "4.3"))]
706706
fn test_tcp_bind_async() -> anyhow::Result<()> {
707+
use std::pin::pin;
708+
707709
use async_executor::LocalExecutor;
708710

709711
async fn test_tcp_bind(executor: &LocalExecutor<'_>) -> std::io::Result<()> {
@@ -743,7 +745,9 @@ fn test_tcp_bind_async() -> anyhow::Result<()> {
743745
thread::Builder::new().stack_size(20000).spawn(move || {
744746
let executor = LocalExecutor::new();
745747

746-
async_io::block_on(test_tcp_bind(&executor)).unwrap();
748+
let fut = &mut pin!(test_tcp_bind(&executor));
749+
750+
async_io::block_on(executor.run(fut)).unwrap();
747751
})?;
748752

749753
Ok(())

0 commit comments

Comments
 (0)