diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md index d3ace200..194c8b4d 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. +- **fixed:** Add `#[must_use]` to `WebSocketUpgrade::on_upgrade` ([#1801]) + +[#1801]: https://github.com/tokio-rs/axum/pull/1801 # 0.6.9 (24. February, 2023) diff --git a/axum/src/extract/ws.rs b/axum/src/extract/ws.rs index 43ef0db0..5c1167c4 100644 --- a/axum/src/extract/ws.rs +++ b/axum/src/extract/ws.rs @@ -282,10 +282,7 @@ impl WebSocketUpgrade { /// Finalize upgrading the connection and call the provided callback with /// the stream. - /// - /// When using `WebSocketUpgrade`, the response produced by this method - /// should be returned from the handler. See the [module docs](self) for an - /// example. + #[must_use = "to setup the WebSocket connection, this response must be returned"] pub fn on_upgrade(self, callback: C) -> Response where C: FnOnce(WebSocket) -> Fut + Send + 'static,