diff --git a/actix-http/benches/status-line.rs b/actix-http/benches/status-line.rs index 252a54dea..f62d18ed8 100644 --- a/actix-http/benches/status-line.rs +++ b/actix-http/benches/status-line.rs @@ -176,7 +176,7 @@ mod _original { buf[5] = b'0'; buf[7] = b'9'; } - _ => {}, + _ => {} } let mut curr: isize = 12; diff --git a/actix-http/src/client/h1proto.rs b/actix-http/src/client/h1proto.rs index 3265394f0..758ad8424 100644 --- a/actix-http/src/client/h1proto.rs +++ b/actix-http/src/client/h1proto.rs @@ -72,7 +72,7 @@ where // send request body match body.size() { - BodySize::None | BodySize::Empty | BodySize::Sized(0) => {}, + BodySize::None | BodySize::Empty | BodySize::Sized(0) => {} _ => send_body(body, Pin::new(&mut framed_inner)).await?, }; diff --git a/actix-http/src/client/h2proto.rs b/actix-http/src/client/h2proto.rs index d35f9e24b..4c609ef22 100644 --- a/actix-http/src/client/h2proto.rs +++ b/actix-http/src/client/h2proto.rs @@ -89,7 +89,7 @@ where CONNECTION | TRANSFER_ENCODING => continue, // http2 specific CONTENT_LENGTH if skip_len => continue, // DATE => has_date = true, - _ => {}, + _ => {} } req.headers_mut().append(key, value.clone()); } diff --git a/actix-http/src/client/pool.rs b/actix-http/src/client/pool.rs index cee823a42..7da2b6234 100644 --- a/actix-http/src/client/pool.rs +++ b/actix-http/src/client/pool.rs @@ -334,7 +334,7 @@ where let mut read_buf = ReadBuf::new(&mut buf); if let ConnectionType::H1(ref mut s) = io { match Pin::new(s).poll_read(cx, &mut read_buf) { - Poll::Pending => {}, + Poll::Pending => {} Poll::Ready(Ok(())) if !read_buf.filled().is_empty() => { if let Some(timeout) = self.config.disconnect_timeout { if let ConnectionType::H1(io) = io { diff --git a/actix-http/src/h1/decoder.rs b/actix-http/src/h1/decoder.rs index d3ac497b6..85379b084 100644 --- a/actix-http/src/h1/decoder.rs +++ b/actix-http/src/h1/decoder.rs @@ -137,7 +137,7 @@ pub(crate) trait MessageType: Sized { expect = true; } } - _ => {}, + _ => {} } headers.append(name, value); @@ -685,7 +685,7 @@ mod tests { match MessageDecoder::::default().decode($e) { Err(err) => match err { ParseError::Io(_) => unreachable!("Parse error expected"), - _ => {}, + _ => {} }, _ => unreachable!("Error expected"), } diff --git a/actix-http/src/h1/dispatcher.rs b/actix-http/src/h1/dispatcher.rs index 41e923b6e..a9510dc1e 100644 --- a/actix-http/src/h1/dispatcher.rs +++ b/actix-http/src/h1/dispatcher.rs @@ -736,7 +736,7 @@ where let _ = this.ka_timer.as_mut().as_pin_mut().unwrap().poll(cx); } } - Poll::Pending => {}, + Poll::Pending => {} } Ok(()) diff --git a/actix-http/src/h1/encoder.rs b/actix-http/src/h1/encoder.rs index 69800e861..4427174ec 100644 --- a/actix-http/src/h1/encoder.rs +++ b/actix-http/src/h1/encoder.rs @@ -118,7 +118,7 @@ pub(crate) trait MessageType: Sized { dst.put_slice(b"connection: close\r\n") } } - _ => {}, + _ => {} } // merging headers from head and extra headers. HeaderMap::new() does not allocate. @@ -148,7 +148,7 @@ pub(crate) trait MessageType: Sized { CONNECTION => continue, TRANSFER_ENCODING | CONTENT_LENGTH if skip_len => continue, DATE => has_date = true, - _ => {}, + _ => {} } let k = key.as_str().as_bytes(); diff --git a/actix-http/src/ws/codec.rs b/actix-http/src/ws/codec.rs index bb68a4d76..ba4a48bba 100644 --- a/actix-http/src/ws/codec.rs +++ b/actix-http/src/ws/codec.rs @@ -184,7 +184,7 @@ impl Encoder for Codec { } } }, - Message::Nop => {}, + Message::Nop => {} } Ok(()) } diff --git a/actix-http/src/ws/frame.rs b/actix-http/src/ws/frame.rs index 25231b2f3..8c49524e6 100644 --- a/actix-http/src/ws/frame.rs +++ b/actix-http/src/ws/frame.rs @@ -125,7 +125,7 @@ impl Parser { debug!("Received close frame with payload length exceeding 125. Morphing to protocol close frame."); return Ok(Some((true, OpCode::Close, None))); } - _ => {}, + _ => {} } // unmask diff --git a/actix-http/src/ws/proto.rs b/actix-http/src/ws/proto.rs index 06db60c67..345681429 100644 --- a/actix-http/src/ws/proto.rs +++ b/actix-http/src/ws/proto.rs @@ -222,7 +222,7 @@ mod test { macro_rules! opcode_into { ($from:expr => $opcode:pat) => { match OpCode::from($from) { - e @ $opcode => {}, + e @ $opcode => {} e => unreachable!("{:?}", e), } }; @@ -232,7 +232,7 @@ mod test { ($from:expr => $opcode:pat) => { let res: u8 = $from.into(); match res { - e @ $opcode => {}, + e @ $opcode => {} e => unreachable!("{:?}", e), } }; diff --git a/actix-multipart/src/server.rs b/actix-multipart/src/server.rs index 73b2756e5..2cde5e8cf 100644 --- a/actix-multipart/src/server.rs +++ b/actix-multipart/src/server.rs @@ -326,7 +326,7 @@ impl InnerMultipart { } } } - _ => {}, + _ => {} } // read field headers for next field @@ -835,7 +835,7 @@ mod tests { async fn test_boundary() { let headers = HeaderMap::new(); match Multipart::boundary(&headers) { - Err(MultipartError::NoContentType) => {}, + Err(MultipartError::NoContentType) => {} _ => unreachable!("should not happen"), } @@ -846,7 +846,7 @@ mod tests { ); match Multipart::boundary(&headers) { - Err(MultipartError::ParseContentType) => {}, + Err(MultipartError::ParseContentType) => {} _ => unreachable!("should not happen"), } @@ -856,7 +856,7 @@ mod tests { header::HeaderValue::from_static("multipart/mixed"), ); match Multipart::boundary(&headers) { - Err(MultipartError::Boundary) => {}, + Err(MultipartError::Boundary) => {} _ => unreachable!("should not happen"), } @@ -956,17 +956,17 @@ mod tests { let mut multipart = Multipart::new(&headers, payload); match multipart.next().await.unwrap() { - Ok(_) => {}, + Ok(_) => {} _ => unreachable!(), } match multipart.next().await.unwrap() { - Ok(_) => {}, + Ok(_) => {} _ => unreachable!(), } match multipart.next().await { - None => {}, + None => {} _ => unreachable!(), } } @@ -993,7 +993,7 @@ mod tests { _ => unreachable!(), } match field.next().await { - None => {}, + None => {} _ => unreachable!(), } } @@ -1010,7 +1010,7 @@ mod tests { _ => unreachable!(), } match field.next().await { - None => {}, + None => {} _ => unreachable!(), } } @@ -1018,7 +1018,7 @@ mod tests { } match multipart.next().await { - None => {}, + None => {} _ => unreachable!(), } } @@ -1066,7 +1066,7 @@ mod tests { } match multipart.next().await { - None => {}, + None => {} _ => unreachable!(), } } diff --git a/actix-web-actors/tests/test_ws.rs b/actix-web-actors/tests/test_ws.rs index a8ade9ff4..a5233e5e0 100644 --- a/actix-web-actors/tests/test_ws.rs +++ b/actix-web-actors/tests/test_ws.rs @@ -21,7 +21,7 @@ impl StreamHandler> for Ws { ws::Message::Text(text) => ctx.text(text), ws::Message::Binary(bin) => ctx.binary(bin), ws::Message::Close(reason) => ctx.close(reason), - _ => {}, + _ => {} } } } diff --git a/awc/src/request.rs b/awc/src/request.rs index abfd39351..51c3f5190 100644 --- a/awc/src/request.rs +++ b/awc/src/request.rs @@ -523,7 +523,7 @@ impl ClientRequest { return Err(InvalidUrl::MissingScheme.into()); } else if let Some(scheme) = uri.scheme() { match scheme.as_str() { - "http" | "ws" | "https" | "wss" => {}, + "http" | "ws" | "https" | "wss" => {} _ => return Err(InvalidUrl::UnknownScheme.into()), } } else { diff --git a/awc/src/response.rs b/awc/src/response.rs index c9886252e..a32412b23 100644 --- a/awc/src/response.rs +++ b/awc/src/response.rs @@ -370,14 +370,14 @@ mod tests { async fn test_body() { let mut req = TestResponse::with_header(header::CONTENT_LENGTH, "xxxx").finish(); match req.body().await.err().unwrap() { - PayloadError::UnknownLength => {}, + PayloadError::UnknownLength => {} _ => unreachable!("error"), } let mut req = TestResponse::with_header(header::CONTENT_LENGTH, "1000000").finish(); match req.body().await.err().unwrap() { - PayloadError::Overflow => {}, + PayloadError::Overflow => {} _ => unreachable!("error"), } @@ -390,7 +390,7 @@ mod tests { .set_payload(Bytes::from_static(b"11111111111111")) .finish(); match req.body().limit(5).await.err().unwrap() { - PayloadError::Overflow => {}, + PayloadError::Overflow => {} _ => unreachable!("error"), } } diff --git a/awc/src/sender.rs b/awc/src/sender.rs index ef65c18dd..d4d3d9b72 100644 --- a/awc/src/sender.rs +++ b/awc/src/sender.rs @@ -86,7 +86,7 @@ impl Future for SendClientRequest { SendClientRequest::Fut(send, delay, response_decompress) => { if delay.is_some() { match Pin::new(delay.as_mut().unwrap()).poll(cx) { - Poll::Pending => {}, + Poll::Pending => {} _ => return Poll::Ready(Err(SendRequestError::Timeout)), } } @@ -127,7 +127,7 @@ impl Future for SendClientRequest { SendClientRequest::Fut(send, delay, _) => { if delay.is_some() { match Pin::new(delay.as_mut().unwrap()).poll(cx) { - Poll::Pending => {}, + Poll::Pending => {} _ => return Poll::Ready(Err(SendRequestError::Timeout)), } } diff --git a/awc/src/ws.rs b/awc/src/ws.rs index 9065302d9..a1fa07d8d 100644 --- a/awc/src/ws.rs +++ b/awc/src/ws.rs @@ -259,7 +259,7 @@ impl WebsocketsRequest { return Err(InvalidUrl::MissingScheme.into()); } else if let Some(scheme) = uri.scheme() { match scheme.as_str() { - "http" | "ws" | "https" | "wss" => {}, + "http" | "ws" | "https" | "wss" => {} _ => return Err(InvalidUrl::UnknownScheme.into()), } } else { diff --git a/awc/tests/test_client.rs b/awc/tests/test_client.rs index 114563b31..6cae77a49 100644 --- a/awc/tests/test_client.rs +++ b/awc/tests/test_client.rs @@ -127,7 +127,7 @@ async fn test_timeout() { let request = client.get(srv.url("/")).send(); match request.await { - Err(SendRequestError::Timeout) => {}, + Err(SendRequestError::Timeout) => {} _ => panic!(), } } @@ -149,7 +149,7 @@ async fn test_timeout_override() { .timeout(Duration::from_millis(50)) .send(); match request.await { - Err(SendRequestError::Timeout) => {}, + Err(SendRequestError::Timeout) => {} _ => panic!(), } } diff --git a/src/info.rs b/src/info.rs index cefe87eb4..75ebf67eb 100644 --- a/src/info.rs +++ b/src/info.rs @@ -55,7 +55,7 @@ impl ConnectionInfo { host = Some(val.trim()); } } - _ => {}, + _ => {} } } } diff --git a/src/middleware/logger.rs b/src/middleware/logger.rs index 83ff5b9ec..c952aeac9 100644 --- a/src/middleware/logger.rs +++ b/src/middleware/logger.rs @@ -522,7 +522,7 @@ impl FormatText { }; *self = FormatText::Str(s.to_string()) } - _ => {}, + _ => {} } } @@ -587,7 +587,7 @@ impl FormatText { *self = s; } - _ => {}, + _ => {} } } } diff --git a/src/types/payload.rs b/src/types/payload.rs index 1b1c1ad73..14457176d 100644 --- a/src/types/payload.rs +++ b/src/types/payload.rs @@ -539,7 +539,7 @@ mod tests { .into_parts(); let res = HttpMessageBody::new(&req, &mut pl).await; match res.err().unwrap() { - PayloadError::UnknownLength => {}, + PayloadError::UnknownLength => {} _ => unreachable!("error"), } @@ -548,7 +548,7 @@ mod tests { .into_parts(); let res = HttpMessageBody::new(&req, &mut pl).await; match res.err().unwrap() { - PayloadError::Overflow => {}, + PayloadError::Overflow => {} _ => unreachable!("error"), } @@ -563,7 +563,7 @@ mod tests { .to_http_parts(); let res = HttpMessageBody::new(&req, &mut pl).limit(5).await; match res.err().unwrap() { - PayloadError::Overflow => {}, + PayloadError::Overflow => {} _ => unreachable!("error"), } }