mirror of https://github.com/fafhrd91/actix-web
clippy fixes
This commit is contained in:
parent
2504c2ecb0
commit
7bc542c56f
|
@ -8,7 +8,7 @@ PR_TYPE
|
||||||
|
|
||||||
|
|
||||||
## PR Checklist
|
## PR Checklist
|
||||||
<!-- Check your PR fulfills the following items. ->>
|
<!-- Check your PR fulfills the following items. -->
|
||||||
<!-- For draft PRs check the boxes as you complete them. -->
|
<!-- For draft PRs check the boxes as you complete them. -->
|
||||||
|
|
||||||
- [ ] Tests for the changes have been added / updated.
|
- [ ] Tests for the changes have been added / updated.
|
||||||
|
|
|
@ -55,6 +55,8 @@ impl Error {
|
||||||
Self::new(Kind::Io)
|
Self::new(Kind::Io)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// used in encoder behind feature flag so ignore unused warning
|
||||||
|
#[allow(unused)]
|
||||||
pub(crate) fn new_encoder() -> Self {
|
pub(crate) fn new_encoder() -> Self {
|
||||||
Self::new(Kind::Encoder)
|
Self::new(Kind::Encoder)
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,7 +135,7 @@ impl ConnectionInfo {
|
||||||
.or_else(|| first_header_value(req, &*X_FORWARDED_HOST))
|
.or_else(|| first_header_value(req, &*X_FORWARDED_HOST))
|
||||||
.or_else(|| req.headers.get(&header::HOST)?.to_str().ok())
|
.or_else(|| req.headers.get(&header::HOST)?.to_str().ok())
|
||||||
.or_else(|| req.uri.authority().map(Authority::as_str))
|
.or_else(|| req.uri.authority().map(Authority::as_str))
|
||||||
.unwrap_or(cfg.host())
|
.unwrap_or_else(|| cfg.host())
|
||||||
.to_owned();
|
.to_owned();
|
||||||
|
|
||||||
let realip_remote_addr = realip_remote_addr
|
let realip_remote_addr = realip_remote_addr
|
||||||
|
|
|
@ -295,6 +295,7 @@ where
|
||||||
let mut svc = HttpService::build()
|
let mut svc = HttpService::build()
|
||||||
.keep_alive(c.keep_alive)
|
.keep_alive(c.keep_alive)
|
||||||
.client_timeout(c.client_timeout)
|
.client_timeout(c.client_timeout)
|
||||||
|
.client_disconnect(c.client_shutdown)
|
||||||
.local_addr(addr);
|
.local_addr(addr);
|
||||||
|
|
||||||
if let Some(handler) = on_connect_fn.clone() {
|
if let Some(handler) = on_connect_fn.clone() {
|
||||||
|
@ -352,7 +353,8 @@ where
|
||||||
let svc = HttpService::build()
|
let svc = HttpService::build()
|
||||||
.keep_alive(c.keep_alive)
|
.keep_alive(c.keep_alive)
|
||||||
.client_timeout(c.client_timeout)
|
.client_timeout(c.client_timeout)
|
||||||
.client_disconnect(c.client_shutdown);
|
.client_disconnect(c.client_shutdown)
|
||||||
|
.local_addr(addr);
|
||||||
|
|
||||||
let svc = if let Some(handler) = on_connect_fn.clone() {
|
let svc = if let Some(handler) = on_connect_fn.clone() {
|
||||||
svc.on_connect_ext(move |io: &_, ext: _| {
|
svc.on_connect_ext(move |io: &_, ext: _| {
|
||||||
|
@ -537,7 +539,9 @@ where
|
||||||
fn_service(|io: UnixStream| async { Ok((io, Protocol::Http1, None)) }).and_then({
|
fn_service(|io: UnixStream| async { Ok((io, Protocol::Http1, None)) }).and_then({
|
||||||
let mut svc = HttpService::build()
|
let mut svc = HttpService::build()
|
||||||
.keep_alive(c.keep_alive)
|
.keep_alive(c.keep_alive)
|
||||||
.client_timeout(c.client_timeout);
|
.client_timeout(c.client_timeout)
|
||||||
|
.client_disconnect(c.client_shutdown)
|
||||||
|
.local_addr(addr);
|
||||||
|
|
||||||
if let Some(handler) = on_connect_fn.clone() {
|
if let Some(handler) = on_connect_fn.clone() {
|
||||||
svc = svc
|
svc = svc
|
||||||
|
@ -568,6 +572,7 @@ where
|
||||||
let factory = self.factory.clone();
|
let factory = self.factory.clone();
|
||||||
let socket_addr =
|
let socket_addr =
|
||||||
net::SocketAddr::new(net::IpAddr::V4(net::Ipv4Addr::new(127, 0, 0, 1)), 8080);
|
net::SocketAddr::new(net::IpAddr::V4(net::Ipv4Addr::new(127, 0, 0, 1)), 8080);
|
||||||
|
|
||||||
self.sockets.push(Socket {
|
self.sockets.push(Socket {
|
||||||
scheme: "http",
|
scheme: "http",
|
||||||
addr: socket_addr,
|
addr: socket_addr,
|
||||||
|
@ -592,6 +597,8 @@ where
|
||||||
HttpService::build()
|
HttpService::build()
|
||||||
.keep_alive(c.keep_alive)
|
.keep_alive(c.keep_alive)
|
||||||
.client_timeout(c.client_timeout)
|
.client_timeout(c.client_timeout)
|
||||||
|
.client_disconnect(c.client_shutdown)
|
||||||
|
.local_addr(socket_addr)
|
||||||
.finish(map_config(fac, move |_| config.clone())),
|
.finish(map_config(fac, move |_| config.clone())),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue