refactor(lib): fix many lint warnings
This commit is contained in:
@@ -12,7 +12,6 @@ use std::error::Error as StdError;
|
||||
use std::fmt;
|
||||
use std::mem;
|
||||
#[cfg(feature = "runtime")] use std::net::SocketAddr;
|
||||
use std::sync::Arc;
|
||||
#[cfg(feature = "runtime")] use std::time::Duration;
|
||||
|
||||
use bytes::Bytes;
|
||||
@@ -785,7 +784,7 @@ where
|
||||
B: Payload,
|
||||
E: H2Exec<<S::Service as Service<Body>>::Future, B>,
|
||||
{
|
||||
pub(super) fn poll_watch<W>(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>, watcher: &W) -> Poll<crate::Result<()>>
|
||||
pub(super) fn poll_watch<W>(self: Pin<&mut Self>, cx: &mut task::Context<'_>, watcher: &W) -> Poll<crate::Result<()>>
|
||||
where
|
||||
E: NewSvcExec<IO, S::Future, S::Service, E, W>,
|
||||
W: Watcher<IO, S::Service, E>,
|
||||
@@ -904,7 +903,7 @@ pub(crate) mod spawn_all {
|
||||
{
|
||||
type Output = ();
|
||||
|
||||
fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll<Self::Output> {
|
||||
fn poll(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll<Self::Output> {
|
||||
// If it weren't for needing to name this type so the `Send` bounds
|
||||
// could be projected to the `Serve` executor, this could just be
|
||||
// an `async fn`, and much safer. Woe is me.
|
||||
|
||||
@@ -216,7 +216,7 @@ where
|
||||
{
|
||||
type Output = crate::Result<()>;
|
||||
|
||||
fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll<Self::Output> {
|
||||
fn poll(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll<Self::Output> {
|
||||
self.spawn_all().poll_watch(cx, &NoopWatcher)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ where
|
||||
{
|
||||
type Output = crate::Result<()>;
|
||||
|
||||
fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll<Self::Output> {
|
||||
fn poll(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll<Self::Output> {
|
||||
// Safety: the futures are NEVER moved, self.state is overwritten instead.
|
||||
let me = unsafe { self.get_unchecked_mut() };
|
||||
loop {
|
||||
|
||||
@@ -259,7 +259,7 @@ mod addr_stream {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn poll_flush(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll<io::Result<()>> {
|
||||
fn poll_flush(self: Pin<&mut Self>, _cx: &mut task::Context<'_>) -> Poll<io::Result<()>> {
|
||||
// TCP flush is a noop
|
||||
Poll::Ready(Ok(()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user