diff --git a/examples/chat.rs b/examples/chat.rs index fdf7246b..fa0d90be 100644 --- a/examples/chat.rs +++ b/examples/chat.rs @@ -44,9 +44,10 @@ async fn main() { .unwrap(); } -async fn websocket(stream: WebSocket, state: extract::Extension>) { - let state = state.0; - +async fn websocket( + stream: WebSocket, + extract::Extension(state): extract::Extension>, +) { // By splitting we can send and receive at the same time. let (mut sender, mut receiver) = stream.split();