1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-26 11:31:09 +00:00

fix awc clippy warning (#2431)

This commit is contained in:
fakeshadow 2021-11-04 23:57:55 +08:00 committed by GitHub
parent 6ec2d7b909
commit 5e554dca35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 9 deletions

View file

@ -19,6 +19,7 @@ use actix_rt::time::{sleep, Sleep};
use actix_service::Service; use actix_service::Service;
use ahash::AHashMap; use ahash::AHashMap;
use futures_core::future::LocalBoxFuture; use futures_core::future::LocalBoxFuture;
use futures_util::FutureExt;
use http::uri::Authority; use http::uri::Authority;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;
use tokio::sync::{OwnedSemaphorePermit, Semaphore}; use tokio::sync::{OwnedSemaphorePermit, Semaphore};
@ -201,7 +202,7 @@ where
// check if the connection is still usable // check if the connection is still usable
if let ConnectionInnerType::H1(ref mut io) = c.conn { if let ConnectionInnerType::H1(ref mut io) = c.conn {
let check = ConnectionCheckFuture { io }; let check = ConnectionCheckFuture { io };
match check.await { match check.now_or_never().expect("ConnectionCheckFuture must never yield with Poll::Pending.") {
ConnectionState::Tainted => { ConnectionState::Tainted => {
inner.close(c.conn); inner.close(c.conn);
continue; continue;

View file

@ -795,17 +795,15 @@ async fn client_unread_response() {
let lst = std::net::TcpListener::bind(addr).unwrap(); let lst = std::net::TcpListener::bind(addr).unwrap();
std::thread::spawn(move || { std::thread::spawn(move || {
for stream in lst.incoming() { let (mut stream, _) = lst.accept().unwrap();
let mut stream = stream.unwrap(); let mut b = [0; 1000];
let mut b = [0; 1000]; let _ = stream.read(&mut b).unwrap();
let _ = stream.read(&mut b).unwrap(); let _ = stream.write_all(
let _ = stream.write_all( b"HTTP/1.1 200 OK\r\n\
b"HTTP/1.1 200 OK\r\n\
connection: close\r\n\ connection: close\r\n\
\r\n\ \r\n\
welcome!", welcome!",
); );
}
}); });
// client request // client request