mirror of https://github.com/fafhrd91/actix-net
Fix clippy
This commit is contained in:
parent
93889776c4
commit
7afda5cab1
|
@ -333,7 +333,7 @@ impl Future for CleanupPending {
|
|||
let mut pending = cell.borrow_mut();
|
||||
let mut i = 0;
|
||||
while i != pending.len() {
|
||||
if let Poll::Ready(_) = Pin::new(&mut pending[i]).poll(cx) {
|
||||
if Pin::new(&mut pending[i]).poll(cx).is_ready() {
|
||||
pending.remove(i);
|
||||
} else {
|
||||
i += 1;
|
||||
|
|
|
@ -286,7 +286,7 @@ impl ServerBuilder {
|
|||
|
||||
// handle signals
|
||||
if !self.no_signals {
|
||||
Signals::start(self.server.clone()).unwrap();
|
||||
Signals::start(self.server.clone());
|
||||
}
|
||||
|
||||
// start http server actor
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
use std::future::Future;
|
||||
use std::io;
|
||||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
#[cfg(not(unix))]
|
||||
use std::io;
|
||||
|
||||
use futures_util::future::lazy;
|
||||
|
||||
use crate::server::Server;
|
||||
|
@ -30,7 +32,7 @@ pub(crate) struct Signals {
|
|||
}
|
||||
|
||||
impl Signals {
|
||||
pub(crate) fn start(srv: Server) -> io::Result<()> {
|
||||
pub(crate) fn start(srv: Server) {
|
||||
actix_rt::spawn(lazy(|_| {
|
||||
#[cfg(not(unix))]
|
||||
{
|
||||
|
@ -66,8 +68,6 @@ impl Signals {
|
|||
actix_rt::spawn(Signals { srv, streams })
|
||||
}
|
||||
}));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -290,10 +290,8 @@ where
|
|||
}
|
||||
State::Error(_) => {
|
||||
// flush write buffer
|
||||
if !this.framed.is_write_buf_empty() {
|
||||
if let Poll::Pending = this.framed.flush(cx) {
|
||||
return Poll::Pending;
|
||||
}
|
||||
if !this.framed.is_write_buf_empty() && this.framed.flush(cx).is_pending() {
|
||||
return Poll::Pending;
|
||||
}
|
||||
Poll::Ready(Err(this.state.take_error()))
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ where
|
|||
type Future = InFlightServiceResponse<T>;
|
||||
|
||||
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||
if let Poll::Pending = self.service.poll_ready(cx)? {
|
||||
if self.service.poll_ready(cx)?.is_pending() {
|
||||
Poll::Pending
|
||||
} else if !self.count.available(cx) {
|
||||
log::trace!("InFlight limit exceeded");
|
||||
|
|
|
@ -160,7 +160,12 @@ where
|
|||
}
|
||||
|
||||
// check nested service
|
||||
if let Poll::Pending = self.service.poll_ready(cx).map_err(InOrderError::Service)? {
|
||||
if self
|
||||
.service
|
||||
.poll_ready(cx)
|
||||
.map_err(InOrderError::Service)?
|
||||
.is_pending()
|
||||
{
|
||||
Poll::Pending
|
||||
} else {
|
||||
Poll::Ready(Ok(()))
|
||||
|
|
Loading…
Reference in New Issue