mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-26 02:19:22 +02:00
cleanup warnings
This commit is contained in:
@ -5,8 +5,8 @@ use std::{fmt, io, mem, time};
|
||||
|
||||
use actix::resolver::{Connect as ResolveConnect, Resolver, ResolverError};
|
||||
use actix::{
|
||||
fut, Actor, ActorContext, ActorFuture, ActorResponse, Addr, AsyncContext, Context,
|
||||
ContextFutureSpawner, Handler, Message, Recipient, StreamHandler2, Supervised,
|
||||
fut, Actor, ActorFuture, ActorResponse, Addr, AsyncContext, Context,
|
||||
ContextFutureSpawner, Handler, Message, Recipient, StreamHandler, Supervised,
|
||||
SystemService, WrapFuture,
|
||||
};
|
||||
|
||||
@ -220,7 +220,7 @@ impl Actor for ClientConnector {
|
||||
self.resolver = Some(Resolver::from_registry())
|
||||
}
|
||||
self.collect_periodic(ctx);
|
||||
ctx.add_stream2(self.acq_rx.take().unwrap());
|
||||
ctx.add_stream(self.acq_rx.take().unwrap());
|
||||
ctx.spawn(Maintenance);
|
||||
}
|
||||
}
|
||||
@ -769,20 +769,17 @@ impl Handler<Connect> for ClientConnector {
|
||||
}
|
||||
}
|
||||
|
||||
impl StreamHandler2<AcquiredConnOperation, ()> for ClientConnector {
|
||||
fn handle(
|
||||
&mut self, msg: Result<Option<AcquiredConnOperation>, ()>,
|
||||
ctx: &mut Context<Self>,
|
||||
) {
|
||||
impl StreamHandler<AcquiredConnOperation, ()> for ClientConnector {
|
||||
fn handle(&mut self, msg: AcquiredConnOperation, _: &mut Context<Self>) {
|
||||
let now = Instant::now();
|
||||
|
||||
match msg {
|
||||
Ok(Some(AcquiredConnOperation::Close(conn))) => {
|
||||
AcquiredConnOperation::Close(conn) => {
|
||||
self.release_key(&conn.key);
|
||||
self.to_close.push(conn);
|
||||
self.stats.closed += 1;
|
||||
}
|
||||
Ok(Some(AcquiredConnOperation::Release(conn))) => {
|
||||
AcquiredConnOperation::Release(conn) => {
|
||||
self.release_key(&conn.key);
|
||||
|
||||
// check connection lifetime and the return to available pool
|
||||
@ -793,10 +790,9 @@ impl StreamHandler2<AcquiredConnOperation, ()> for ClientConnector {
|
||||
.push_back(Conn(Instant::now(), conn));
|
||||
}
|
||||
}
|
||||
Ok(Some(AcquiredConnOperation::ReleaseKey(key))) => {
|
||||
AcquiredConnOperation::ReleaseKey(key) => {
|
||||
self.release_key(&key);
|
||||
}
|
||||
_ => ctx.stop(),
|
||||
}
|
||||
|
||||
// check keep-alive
|
||||
|
@ -1,13 +1,11 @@
|
||||
use std::cell::RefCell;
|
||||
use std::{fmt, str};
|
||||
|
||||
use bytes::Bytes;
|
||||
use cookie::Cookie;
|
||||
use futures::{Async, Poll, Stream};
|
||||
use http::header::{self, HeaderValue};
|
||||
use http::{HeaderMap, StatusCode, Version};
|
||||
|
||||
use error::{CookieParseError, PayloadError};
|
||||
use error::CookieParseError;
|
||||
use httpmessage::HttpMessage;
|
||||
|
||||
use super::pipeline::Pipeline;
|
||||
|
Reference in New Issue
Block a user