From 5d79c638f472344824079469f676468e23e8af2d Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Tue, 21 Dec 2021 11:17:56 +0100 Subject: [PATCH] Require `Output = ()` on `WebSocketStream::on_upgrade` (#646) Fixes https://github.com/tokio-rs/axum/issues/636 --- axum/CHANGELOG.md | 4 +++- axum/src/extract/ws.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md index 592e319d..0362b501 100644 --- a/axum/CHANGELOG.md +++ b/axum/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # Unreleased -- None. +- **breaking:** Require `Output = ()` on `WebSocketStream::on_upgrade` ([#644]) + +[#644]: https://github.com/tokio-rs/axum/pull/644 # 0.4.4 (13. January, 2021) diff --git a/axum/src/extract/ws.rs b/axum/src/extract/ws.rs index 880ab1e2..235fe6d6 100644 --- a/axum/src/extract/ws.rs +++ b/axum/src/extract/ws.rs @@ -201,7 +201,7 @@ impl WebSocketUpgrade { pub fn on_upgrade(self, callback: F) -> Response where F: FnOnce(WebSocket) -> Fut + Send + 'static, - Fut: Future + Send + 'static, + Fut: Future + Send + 'static, { let on_upgrade = self.on_upgrade; let config = self.config;