mirror of https://github.com/tokio-rs/axum
Fix warnings and errors from beta Rust (#2904)
This commit is contained in:
parent
1ac617a1b5
commit
6efcb75d99
|
@ -783,8 +783,9 @@ pub mod close_code {
|
|||
pub const PROTOCOL: u16 = 1002;
|
||||
|
||||
/// Indicates that an endpoint is terminating the connection because it has received a type of
|
||||
/// data it cannot accept (e.g., an endpoint that understands only text data MAY send this if
|
||||
/// it receives a binary message).
|
||||
/// data that it cannot accept.
|
||||
///
|
||||
/// For example, an endpoint MAY send this if it understands only text data, but receives a binary message.
|
||||
pub const UNSUPPORTED: u16 = 1003;
|
||||
|
||||
/// Indicates that no status code was included in a closing frame.
|
||||
|
@ -794,12 +795,15 @@ pub mod close_code {
|
|||
pub const ABNORMAL: u16 = 1006;
|
||||
|
||||
/// Indicates that an endpoint is terminating the connection because it has received data
|
||||
/// within a message that was not consistent with the type of the message (e.g., non-UTF-8
|
||||
/// RFC3629 data within a text message).
|
||||
/// within a message that was not consistent with the type of the message.
|
||||
///
|
||||
/// For example, an endpoint received non-UTF-8 RFC3629 data within a text message.
|
||||
pub const INVALID: u16 = 1007;
|
||||
|
||||
/// Indicates that an endpoint is terminating the connection because it has received a message
|
||||
/// that violates its policy. This is a generic status code that can be returned when there is
|
||||
/// that violates its policy.
|
||||
///
|
||||
/// This is a generic status code that can be returned when there is
|
||||
/// no other more suitable status code (e.g., `UNSUPPORTED` or `SIZE`) or if there is a need to
|
||||
/// hide specific details about the policy.
|
||||
pub const POLICY: u16 = 1008;
|
||||
|
@ -808,10 +812,13 @@ pub mod close_code {
|
|||
/// that is too big for it to process.
|
||||
pub const SIZE: u16 = 1009;
|
||||
|
||||
/// Indicates that an endpoint (client) is terminating the connection because it has expected
|
||||
/// the server to negotiate one or more extension, but the server didn't return them in the
|
||||
/// response message of the WebSocket handshake. The list of extensions that are needed should
|
||||
/// be given as the reason for closing. Note that this status code is not used by the server,
|
||||
/// Indicates that an endpoint (client) is terminating the connection because the server
|
||||
/// did not respond to extension negotiation correctly.
|
||||
///
|
||||
/// Specifically, the client has expected the server to negotiate one or more extension(s),
|
||||
/// but the server didn't return them in the response message of the WebSocket handshake.
|
||||
/// The list of extensions that are needed should be given as the reason for closing.
|
||||
/// Note that this status code is not used by the server,
|
||||
/// because it can fail the WebSocket handshake instead.
|
||||
pub const EXTENSION: u16 = 1010;
|
||||
|
||||
|
|
|
@ -328,6 +328,8 @@ where
|
|||
) -> _,
|
||||
> = svc.oneshot(req).map(|result| match result {
|
||||
Ok(res) => res.into_response(),
|
||||
|
||||
#[allow(unreachable_patterns)]
|
||||
Err(err) => match err {},
|
||||
});
|
||||
|
||||
|
|
|
@ -341,6 +341,8 @@ impl Next {
|
|||
pub async fn run(mut self, req: Request) -> Response {
|
||||
match self.inner.call(req).await {
|
||||
Ok(res) => res,
|
||||
|
||||
#[allow(unreachable_patterns)]
|
||||
Err(err) => match err {},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -278,6 +278,8 @@ macro_rules! impl_service {
|
|||
Ok(res) => {
|
||||
f($($ty,)* res).await.into_response()
|
||||
}
|
||||
|
||||
#[allow(unreachable_patterns)]
|
||||
Err(err) => match err {}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -236,6 +236,8 @@ impl Future for InfallibleRouteFuture {
|
|||
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||
match futures_util::ready!(self.project().future.poll(cx)) {
|
||||
Ok(response) => Poll::Ready(response),
|
||||
|
||||
#[allow(unreachable_patterns)]
|
||||
Err(err) => match err {},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
//!
|
||||
//! [hyper-util]: https://crates.io/crates/hyper-util
|
||||
|
||||
#![allow(unreachable_patterns)]
|
||||
|
||||
use std::convert::Infallible;
|
||||
use std::net::SocketAddr;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
//! ```not_rust
|
||||
//! cargo run -p example-unix-domain-socket
|
||||
//! ```
|
||||
#![allow(unreachable_patterns)]
|
||||
|
||||
#[cfg(unix)]
|
||||
#[tokio::main]
|
||||
|
|
Loading…
Reference in New Issue