From 13881ba73a2c72234de2d3f2e6986d5bf59de171 Mon Sep 17 00:00:00 2001 From: Marko Bencun Date: Sat, 29 Jun 2024 14:36:49 +0200 Subject: [PATCH] web: use `async` syntax --- bitbox-bridge/src/web.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bitbox-bridge/src/web.rs b/bitbox-bridge/src/web.rs index 7dcf3e8..b9890c6 100644 --- a/bitbox-bridge/src/web.rs +++ b/bitbox-bridge/src/web.rs @@ -155,11 +155,7 @@ async fn ws_upgrade( })) } -pub fn create( - usb_devices: UsbDevices, - notify_tx: mpsc::Sender<()>, - addr: SocketAddr, -) -> impl std::future::Future { +pub async fn create(usb_devices: UsbDevices, notify_tx: mpsc::Sender<()>, addr: SocketAddr) { // create a warp filter out of "usb_devices" to pass it into our handlers later let usb_devices = warp::any().map(move || (usb_devices.clone(), notify_tx.clone())); @@ -322,5 +318,5 @@ pub fn create( } } }); - warp::serve(routes).run(addr) + warp::serve(routes).run(addr).await }