1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-01 22:11:20 +00:00

address clippy lints

This commit is contained in:
Rob Ede 2022-06-27 03:12:36 +01:00
parent 3d6ea7fe9b
commit f7d7d92984
No known key found for this signature in database
GPG key ID: 97C636207D3EF933
4 changed files with 6 additions and 4 deletions

View file

@ -481,6 +481,7 @@ mod tests {
assert_poll_next_none!(pl); assert_poll_next_none!(pl);
} }
#[allow(clippy::let_unit_value)]
#[actix_rt::test] #[actix_rt::test]
async fn test_unit() { async fn test_unit() {
let pl = (); let pl = ();

View file

@ -237,7 +237,7 @@ mod tests {
.await; .await;
let mut stream = net::TcpStream::connect(srv.addr()).unwrap(); let mut stream = net::TcpStream::connect(srv.addr()).unwrap();
let _ = stream stream
.write_all(b"GET /camel HTTP/1.1\r\nConnection: Close\r\n\r\n") .write_all(b"GET /camel HTTP/1.1\r\nConnection: Close\r\n\r\n")
.unwrap(); .unwrap();
let mut data = vec![]; let mut data = vec![];
@ -251,7 +251,7 @@ mod tests {
assert!(memmem::find(&data, b"content-length").is_none()); assert!(memmem::find(&data, b"content-length").is_none());
let mut stream = net::TcpStream::connect(srv.addr()).unwrap(); let mut stream = net::TcpStream::connect(srv.addr()).unwrap();
let _ = stream stream
.write_all(b"GET /lower HTTP/1.1\r\nConnection: Close\r\n\r\n") .write_all(b"GET /lower HTTP/1.1\r\nConnection: Close\r\n\r\n")
.unwrap(); .unwrap();
let mut data = vec![]; let mut data = vec![];

View file

@ -183,6 +183,7 @@ mod tests {
assert!(Path::<MyStruct>::from_request(&req, &mut pl).await.is_err()); assert!(Path::<MyStruct>::from_request(&req, &mut pl).await.is_err());
} }
#[allow(clippy::let_unit_value)]
#[actix_rt::test] #[actix_rt::test]
async fn test_tuple_extract() { async fn test_tuple_extract() {
let resource = ResourceDef::new("/{key}/{value}/"); let resource = ResourceDef::new("/{key}/{value}/");

View file

@ -113,7 +113,7 @@ pub struct BytesExtractFut {
body_fut: HttpMessageBody, body_fut: HttpMessageBody,
} }
impl<'a> Future for BytesExtractFut { impl Future for BytesExtractFut {
type Output = Result<Bytes, Error>; type Output = Result<Bytes, Error>;
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> { fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
@ -167,7 +167,7 @@ pub struct StringExtractFut {
encoding: &'static Encoding, encoding: &'static Encoding,
} }
impl<'a> Future for StringExtractFut { impl Future for StringExtractFut {
type Output = Result<String, Error>; type Output = Result<String, Error>;
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> { fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {