From 1d19d904fbcc2dbbafc4ca34fc8eaef3e86d48c6 Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Tue, 21 Dec 2021 11:06:25 +0100 Subject: [PATCH] Require `Output = ()` on `WebSocketStream::on_upgrade` Fixes https://github.com/tokio-rs/axum/issues/636 --- axum/CHANGELOG.md | 2 ++ axum/src/extract/ws.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md index 6a51700384..814074bf15 100644 --- a/axum/CHANGELOG.md +++ b/axum/CHANGELOG.md @@ -16,11 +16,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 `Request`) has previously taken the request extensions. Thus `PathRejection` now contains a variant with `ExtensionsAlreadyExtracted`. This is not a breaking change since `PathRejection` is marked as `#[non_exhaustive]` ([#619]) +- **breaking:** Require `Output = ()` on `WebSocketStream::on_upgrade` ([#644]) [#599]: https://github.com/tokio-rs/axum/pull/599 [#600]: https://github.com/tokio-rs/axum/pull/600 [#607]: https://github.com/tokio-rs/axum/pull/607 [#619]: https://github.com/tokio-rs/axum/pull/619 +[#644]: https://github.com/tokio-rs/axum/pull/644 # 0.4.2 (06. December, 2021) diff --git a/axum/src/extract/ws.rs b/axum/src/extract/ws.rs index 9125028504..ee7ac0af56 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;