1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 06:57:43 +02:00

chore: address clippy warnings

This commit is contained in:
Rob Ede
2023-07-20 11:02:15 +01:00
parent 1040bc3d17
commit 3eb5a059ad
22 changed files with 87 additions and 92 deletions

View File

@ -12,7 +12,7 @@ pub use self::{decoder::Decoder, encoder::Encoder};
/// Special-purpose writer for streaming (de-)compression.
///
/// Pre-allocates 8KiB of capacity.
pub(self) struct Writer {
struct Writer {
buf: BytesMut,
}

View File

@ -50,7 +50,7 @@ mod tests {
#[test]
fn test_apply_mask() {
let mask = [0x6d, 0xb6, 0xb2, 0x80];
let unmasked = vec![
let unmasked = [
0xf3, 0x00, 0x01, 0x02, 0x03, 0x80, 0x81, 0x82, 0xff, 0xfe, 0x00, 0x17, 0x74, 0xf9,
0x12, 0x03,
];

View File

@ -1,5 +1,3 @@
#![allow(clippy::uninlined_format_args)]
use std::{
convert::Infallible,
io::{Read, Write},
@ -139,7 +137,7 @@ async fn expect_continue_h1() {
#[actix_rt::test]
async fn chunked_payload() {
let chunk_sizes = vec![32768, 32, 32768];
let chunk_sizes = [32768, 32, 32768];
let total_size: usize = chunk_sizes.iter().sum();
let mut srv = test_server(|| {
@ -402,7 +400,7 @@ async fn content_length() {
let mut srv = test_server(|| {
HttpService::build()
.h1(|req: Request| {
let indx: usize = req.uri().path()[1..].parse().unwrap();
let idx: usize = req.uri().path()[1..].parse().unwrap();
let statuses = [
StatusCode::NO_CONTENT,
StatusCode::CONTINUE,
@ -411,7 +409,7 @@ async fn content_length() {
StatusCode::OK,
StatusCode::NOT_FOUND,
];
ok::<_, Infallible>(Response::new(statuses[indx]))
ok::<_, Infallible>(Response::new(statuses[idx]))
})
.tcp()
})