From 0d3758ad6bd290689c99eab029ef652176b538d7 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Tue, 12 Apr 2022 20:14:12 +0200 Subject: [PATCH] net: make run() noreturn. --- embassy-net/src/stack.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/embassy-net/src/stack.rs b/embassy-net/src/stack.rs index f1f92e8ed..8623a7275 100644 --- a/embassy-net/src/stack.rs +++ b/embassy-net/src/stack.rs @@ -230,12 +230,13 @@ pub fn is_config_up() -> bool { STACK.borrow().borrow().as_ref().unwrap().config_up } -pub async fn run() { +pub async fn run() -> ! { futures::future::poll_fn(|cx| { Stack::with(|stack| stack.poll(cx)); Poll::<()>::Pending }) - .await + .await; + unreachable!() } fn instant_to_smoltcp(instant: Instant) -> SmolInstant {