1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-27 09:42:57 +01:00

import some traits as _

This commit is contained in:
Rob Ede 2021-03-11 03:48:38 +00:00
parent c8f6d37290
commit 3dc2d145ef
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
12 changed files with 33 additions and 22 deletions

View File

@ -3,7 +3,7 @@ use std::{env, io};
use actix_http::{Error, HttpService, Request, Response};
use actix_server::Server;
use bytes::BytesMut;
use futures_util::StreamExt;
use futures_util::StreamExt as _;
use http::header::HeaderValue;
use log::info;

View File

@ -4,7 +4,7 @@ use actix_http::http::HeaderValue;
use actix_http::{Error, HttpService, Request, Response};
use actix_server::Server;
use bytes::BytesMut;
use futures_util::StreamExt;
use futures_util::StreamExt as _;
use log::info;
async fn handle_request(mut req: Request) -> Result<Response, Error> {

View File

@ -7,7 +7,7 @@ use actix_codec::{AsyncRead, AsyncWrite, Framed, ReadBuf};
use bytes::buf::BufMut;
use bytes::{Bytes, BytesMut};
use futures_core::Stream;
use futures_util::{future::poll_fn, SinkExt};
use futures_util::{future::poll_fn, SinkExt as _};
use crate::error::PayloadError;
use crate::h1;
@ -198,7 +198,7 @@ where
}
}
SinkExt::flush(framed.get_mut()).await?;
framed.get_mut().flush().await?;
Ok(())
}

View File

@ -5,8 +5,10 @@ use actix_codec::{AsyncRead, AsyncWrite};
use actix_service::Service;
use bytes::{Bytes, BytesMut};
use futures_core::ready;
use h2::server::{Connection, SendResponse};
use h2::SendStream;
use h2::{
server::{Connection, SendResponse},
SendStream,
};
use http::header::{HeaderValue, CONNECTION, CONTENT_LENGTH, DATE, TRANSFER_ENCODING};
use log::{error, trace};

View File

@ -13,7 +13,7 @@ use actix_service::{
use bytes::Bytes;
use futures_core::ready;
use futures_util::future::ok;
use h2::server::{self, Handshake};
use h2::server::{handshake, Handshake};
use log::error;
use crate::body::MessageBody;
@ -307,7 +307,7 @@ where
Some(self.cfg.clone()),
addr,
on_connect_data,
server::handshake(io),
handshake(io),
),
}
}

View File

@ -1,14 +1,19 @@
use std::marker::PhantomData;
use std::pin::Pin;
use std::task::{Context, Poll};
use std::{fmt, net, rc::Rc};
use std::{
fmt,
future::Future,
marker::PhantomData,
net,
pin::Pin,
rc::Rc,
task::{Context, Poll},
};
use actix_codec::{AsyncRead, AsyncWrite, Framed};
use actix_rt::net::TcpStream;
use actix_service::{pipeline_factory, IntoServiceFactory, Service, ServiceFactory};
use bytes::Bytes;
use futures_core::{ready, Future};
use h2::server::{self, Handshake};
use futures_core::ready;
use h2::server::{handshake, Handshake};
use pin_project::pin_project;
use crate::body::MessageBody;
@ -562,7 +567,7 @@ where
match proto {
Protocol::Http2 => HttpServiceHandlerResponse {
state: State::H2Handshake(Some((
server::handshake(io),
handshake(io),
self.cfg.clone(),
self.flow.clone(),
on_connect_data,

View File

@ -1,7 +1,7 @@
use time::{Date, OffsetDateTime, PrimitiveDateTime};
/// Attempt to parse a `time` string as one of either RFC 1123, RFC 850, or asctime.
pub fn parse_http_date(time: &str) -> Option<PrimitiveDateTime> {
pub(crate) fn parse_http_date(time: &str) -> Option<PrimitiveDateTime> {
try_parse_rfc_1123(time)
.or_else(|| try_parse_rfc_850(time))
.or_else(|| try_parse_asctime(time))

View File

@ -6,7 +6,7 @@ use actix_service::ServiceFactoryExt;
use bytes::Bytes;
use futures_util::{
future::{self, ok},
StreamExt,
StreamExt as _,
};
const STR: &str = "Hello World Hello World Hello World Hello World Hello World \

View File

@ -12,8 +12,11 @@ use actix_http::{body, Error, HttpService, Request, Response};
use actix_http_test::test_server;
use actix_service::{fn_service, ServiceFactoryExt};
use bytes::{Bytes, BytesMut};
use futures_util::future::{err, ok, ready};
use futures_util::stream::{once, Stream, StreamExt};
use futures_core::Stream;
use futures_util::{
future::{err, ok, ready},
stream::{once, StreamExt as _},
};
use openssl::{
pkey::PKey,
ssl::{SslAcceptor, SslMethod},

View File

@ -10,8 +10,9 @@ use actix_http_test::test_server;
use actix_service::{fn_factory_with_config, fn_service};
use bytes::{Bytes, BytesMut};
use futures_core::Stream;
use futures_util::future::{self, err, ok};
use futures_util::stream::{once, Stream, StreamExt};
use futures_util::stream::{once, StreamExt as _};
use rustls::{
internal::pemfile::{certs, pkcs8_private_keys},
NoClientAuth, ServerConfig as RustlsServerConfig,

View File

@ -7,7 +7,7 @@ use actix_rt::time::sleep;
use actix_service::fn_service;
use bytes::Bytes;
use futures_util::future::{self, err, ok, ready, FutureExt};
use futures_util::stream::{once, StreamExt};
use futures_util::stream::{once, StreamExt as _};
use regex::Regex;
use actix_http::HttpMessage;

View File

@ -12,7 +12,7 @@ use actix_utils::dispatcher::Dispatcher;
use bytes::Bytes;
use futures_util::future;
use futures_util::task::{Context, Poll};
use futures_util::{SinkExt, StreamExt};
use futures_util::{SinkExt as _, StreamExt as _};
struct WsService<T>(Arc<Mutex<(PhantomData<T>, Cell<bool>)>>);