mirror of
https://github.com/fafhrd91/actix-net
synced 2025-06-26 19:47:43 +02:00
Suppress/fix clippy warnings
This commit is contained in:
@ -220,7 +220,7 @@ impl ServerBuilder {
|
||||
self.services.push(StreamNewService::create(
|
||||
name.as_ref().to_string(),
|
||||
token,
|
||||
factory.clone(),
|
||||
factory,
|
||||
addr,
|
||||
));
|
||||
self.sockets
|
||||
|
@ -91,7 +91,7 @@ impl ConfiguredService {
|
||||
|
||||
pub(super) fn stream(&mut self, token: Token, name: String, addr: net::SocketAddr) {
|
||||
self.names.insert(token, (name.clone(), addr));
|
||||
self.topics.insert(name.clone(), token);
|
||||
self.topics.insert(name, token);
|
||||
self.services.push(token);
|
||||
}
|
||||
}
|
||||
|
@ -315,6 +315,8 @@ enum WorkerState {
|
||||
impl Future for Worker {
|
||||
type Output = ();
|
||||
|
||||
// FIXME: remove this attribute
|
||||
#[allow(clippy::never_loop)]
|
||||
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||
// `StopWorker` message handler
|
||||
if let Poll::Ready(Some(StopCommand { graceful, result })) =
|
||||
@ -368,11 +370,8 @@ impl Future for Worker {
|
||||
Ok(false) => {
|
||||
// push connection back to queue
|
||||
if let Some(conn) = conn {
|
||||
match self.state {
|
||||
WorkerState::Unavailable(ref mut conns) => {
|
||||
conns.push(conn);
|
||||
}
|
||||
_ => (),
|
||||
if let WorkerState::Unavailable(ref mut conns) = self.state {
|
||||
conns.push(conn);
|
||||
}
|
||||
}
|
||||
Poll::Pending
|
||||
|
@ -41,7 +41,7 @@ fn test_bind() {
|
||||
|
||||
thread::sleep(time::Duration::from_millis(500));
|
||||
assert!(net::TcpStream::connect(addr).is_ok());
|
||||
let _ = sys.stop();
|
||||
sys.stop();
|
||||
let _ = h.join();
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ fn test_listen() {
|
||||
|
||||
thread::sleep(time::Duration::from_millis(500));
|
||||
assert!(net::TcpStream::connect(addr).is_ok());
|
||||
let _ = sys.stop();
|
||||
sys.stop();
|
||||
let _ = h.join();
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ fn test_start() {
|
||||
assert!(net::TcpStream::connect(addr).is_err());
|
||||
|
||||
thread::sleep(time::Duration::from_millis(100));
|
||||
let _ = sys.stop();
|
||||
sys.stop();
|
||||
let _ = h.join();
|
||||
}
|
||||
|
||||
@ -178,6 +178,6 @@ fn test_configure() {
|
||||
assert!(net::TcpStream::connect(addr2).is_ok());
|
||||
assert!(net::TcpStream::connect(addr3).is_ok());
|
||||
assert_eq!(num.load(Relaxed), 1);
|
||||
let _ = sys.stop();
|
||||
sys.stop();
|
||||
let _ = h.join();
|
||||
}
|
||||
|
Reference in New Issue
Block a user