diff --git a/src/engine/runtime.rs b/src/engine/runtime.rs index 25be7ca..e163781 100644 --- a/src/engine/runtime.rs +++ b/src/engine/runtime.rs @@ -730,10 +730,7 @@ impl WXRuntime { request, addr, respond_to, - } => { - let response = self.execute_route(request, addr); - respond_to.send(response).unwrap(); - } + } => respond_to.send(self.execute_route(request, addr)).unwrap(), } } } diff --git a/src/engine/server.rs b/src/engine/server.rs index 09f283d..7c53d03 100644 --- a/src/engine/server.rs +++ b/src/engine/server.rs @@ -75,8 +75,10 @@ impl WXServer { .build()?; loop { let (stream, addr) = listener.accept().await?; - let io = TokioIo::new(stream); - runtime.spawn(Self::serve(io, svc.clone_with_address(addr))); + runtime.spawn(Self::serve( + TokioIo::new(stream), + svc.clone_with_address(addr), + )); } }