mirror of
https://github.com/actix/actix-web.git
synced 2025-01-01 21:08:43 +00:00
Fix Clippy warnings
This commit is contained in:
parent
7ba14fd113
commit
f27dd19093
7 changed files with 7 additions and 13 deletions
|
@ -14,7 +14,6 @@ use derive_more::{Display, From};
|
||||||
pub use futures_channel::oneshot::Canceled;
|
pub use futures_channel::oneshot::Canceled;
|
||||||
use http::uri::InvalidUri;
|
use http::uri::InvalidUri;
|
||||||
use http::{header, Error as HttpError, StatusCode};
|
use http::{header, Error as HttpError, StatusCode};
|
||||||
use httparse;
|
|
||||||
use serde::de::value::Error as DeError;
|
use serde::de::value::Error as DeError;
|
||||||
use serde_json::error::Error as JsonError;
|
use serde_json::error::Error as JsonError;
|
||||||
use serde_urlencoded::ser::Error as FormError;
|
use serde_urlencoded::ser::Error as FormError;
|
||||||
|
|
|
@ -8,7 +8,6 @@ use actix_codec::Decoder;
|
||||||
use bytes::{Buf, Bytes, BytesMut};
|
use bytes::{Buf, Bytes, BytesMut};
|
||||||
use http::header::{HeaderName, HeaderValue};
|
use http::header::{HeaderName, HeaderValue};
|
||||||
use http::{header, Method, StatusCode, Uri, Version};
|
use http::{header, Method, StatusCode, Uri, Version};
|
||||||
use httparse;
|
|
||||||
use log::{debug, error, trace};
|
use log::{debug, error, trace};
|
||||||
|
|
||||||
use crate::error::ParseError;
|
use crate::error::ParseError;
|
||||||
|
|
|
@ -423,7 +423,7 @@ impl ContentDisposition {
|
||||||
|
|
||||||
/// Return the value of *name* if exists.
|
/// Return the value of *name* if exists.
|
||||||
pub fn get_name(&self) -> Option<&str> {
|
pub fn get_name(&self) -> Option<&str> {
|
||||||
self.parameters.iter().filter_map(|p| p.as_name()).nth(0)
|
self.parameters.iter().filter_map(|p| p.as_name()).next()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the value of *filename* if exists.
|
/// Return the value of *filename* if exists.
|
||||||
|
@ -431,7 +431,7 @@ impl ContentDisposition {
|
||||||
self.parameters
|
self.parameters
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|p| p.as_filename())
|
.filter_map(|p| p.as_filename())
|
||||||
.nth(0)
|
.next()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the value of *filename\** if exists.
|
/// Return the value of *filename\** if exists.
|
||||||
|
@ -439,7 +439,7 @@ impl ContentDisposition {
|
||||||
self.parameters
|
self.parameters
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|p| p.as_filename_ext())
|
.filter_map(|p| p.as_filename_ext())
|
||||||
.nth(0)
|
.next()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the value of the parameter which the `name` matches.
|
/// Return the value of the parameter which the `name` matches.
|
||||||
|
@ -448,7 +448,7 @@ impl ContentDisposition {
|
||||||
self.parameters
|
self.parameters
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|p| p.as_unknown(name))
|
.filter_map(|p| p.as_unknown(name))
|
||||||
.nth(0)
|
.next()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the value of the extended parameter which the `name` matches.
|
/// Return the value of the extended parameter which the `name` matches.
|
||||||
|
@ -457,7 +457,7 @@ impl ContentDisposition {
|
||||||
self.parameters
|
self.parameters
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|p| p.as_unknown_ext(name))
|
.filter_map(|p| p.as_unknown_ext(name))
|
||||||
.nth(0)
|
.next()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ pub fn write_content_length(n: usize, bytes: &mut BytesMut) {
|
||||||
} else if n < 1_000_000 {
|
} else if n < 1_000_000 {
|
||||||
let n = n as u32;
|
let n = n as u32;
|
||||||
|
|
||||||
let d100000 = (n / 100000) as u8;
|
let d100000 = (n / 100_000) as u8;
|
||||||
let d10000 = ((n / 10000) % 10) as u8;
|
let d10000 = ((n / 10000) % 10) as u8;
|
||||||
let d1000 = ((n / 1000) % 10) as u8;
|
let d1000 = ((n / 1000) % 10) as u8;
|
||||||
let d100 = ((n / 100) % 10) as u8;
|
let d100 = ((n / 100) % 10) as u8;
|
||||||
|
@ -149,7 +149,7 @@ pub(crate) fn write_usize(n: usize, bytes: &mut BytesMut) {
|
||||||
let lsd = (n % 10) as u8;
|
let lsd = (n % 10) as u8;
|
||||||
|
|
||||||
// remove the lsd from n
|
// remove the lsd from n
|
||||||
n = n / 10;
|
n /= 10;
|
||||||
|
|
||||||
buf.put_u8(DIGITS_START + lsd);
|
buf.put_u8(DIGITS_START + lsd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ use std::{fmt, str};
|
||||||
use bytes::{Bytes, BytesMut};
|
use bytes::{Bytes, BytesMut};
|
||||||
use futures_core::Stream;
|
use futures_core::Stream;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use serde_json;
|
|
||||||
|
|
||||||
use crate::body::{Body, BodyStream, MessageBody, ResponseBody};
|
use crate::body::{Body, BodyStream, MessageBody, ResponseBody};
|
||||||
use crate::cookie::{Cookie, CookieJar};
|
use crate::cookie::{Cookie, CookieJar};
|
||||||
|
|
|
@ -2,7 +2,6 @@ use std::convert::TryFrom;
|
||||||
|
|
||||||
use bytes::{Buf, BufMut, BytesMut};
|
use bytes::{Buf, BufMut, BytesMut};
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use rand;
|
|
||||||
|
|
||||||
use crate::ws::mask::apply_mask;
|
use crate::ws::mask::apply_mask;
|
||||||
use crate::ws::proto::{CloseCode, CloseReason, OpCode};
|
use crate::ws::proto::{CloseCode, CloseReason, OpCode};
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
use base64;
|
|
||||||
use sha1;
|
|
||||||
use std::convert::{From, Into};
|
use std::convert::{From, Into};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue