Skip to content

Commit

Permalink
Replace weird doc paragraph by compiler-checked must_use attribute (#…
Browse files Browse the repository at this point in the history
…1801)

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
  • Loading branch information
jplatte and davidpdrsn authored Mar 3, 2023
1 parent 416a056 commit 43883b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 3 additions & 1 deletion axum/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 1 addition & 4 deletions axum/src/extract/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,7 @@ impl<F> WebSocketUpgrade<F> {

/// 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<C, Fut>(self, callback: C) -> Response
where
C: FnOnce(WebSocket) -> Fut + Send + 'static,
Expand Down

0 comments on commit 43883b8

Please sign in to comment.