From 73c1b46631ec303e0116aacd0234755d99d3c413 Mon Sep 17 00:00:00 2001 From: nils <48135649+Nilstrieb@users.noreply.github.com> Date: Tue, 7 Mar 2023 17:23:04 +0100 Subject: [PATCH] loop --- hyper/src/lib.rs | 2 -- hyper/src/server/server.rs | 29 ++++++++--------------------- hyper/src/service/make.rs | 8 -------- 3 files changed, 8 insertions(+), 31 deletions(-) diff --git a/hyper/src/lib.rs b/hyper/src/lib.rs index d5e12b5..da9faa9 100644 --- a/hyper/src/lib.rs +++ b/hyper/src/lib.rs @@ -1,5 +1,3 @@ -#![deny(missing_docs)] -#![deny(missing_debug_implementations)] #![cfg_attr(test, deny(rust_2018_idioms))] #![cfg_attr(all(test, feature = "full"), deny(unreachable_pub))] #![cfg_attr(all(test, feature = "full"), deny(warnings))] diff --git a/hyper/src/server/server.rs b/hyper/src/server/server.rs index 9eb7119..aa27c5b 100644 --- a/hyper/src/server/server.rs +++ b/hyper/src/server/server.rs @@ -23,12 +23,7 @@ pub struct Builder { incoming: I, protocol: E, } -#[cfg_attr(docsrs, doc(cfg(any(feature = "http1", feature = "http2"))))] -impl Server { - pub fn builder(incoming: I) -> Builder { - loop {} - } -} + #[cfg(feature = "tcp")] #[cfg_attr( docsrs, @@ -40,6 +35,10 @@ impl Server { } } +fn mk() -> T { + loop {} +} + #[cfg_attr(docsrs, doc(cfg(any(feature = "http1", feature = "http2"))))] impl Future for Server where @@ -49,26 +48,14 @@ where E: NewSvcExec, { type Output = (); - fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { loop { - let fut = NewSvcTask::new(NoopWatcher); - unsafe { - self.as_mut() - .get_unchecked_mut() - .protocol - .execute_new_svc(fut); - } + let _a: NewSvcTask>::Service, E, NoopWatcher> = mk(); } } } impl Builder { - #[doc(hidden)] - #[cfg(feature = "http1")] - pub fn http1_pipeline_flush(self, val: bool) -> Self { - loop {} - } - pub fn serve(self, _: S) -> Server where I: Accept, @@ -91,7 +78,7 @@ where } pub(crate) mod new_svc { use super::Watcher; - use crate::body::{Body, HttpBody}; + use crate::body::Body; use crate::common::exec::ConnStreamExec; use crate::common::{task, Future, Pin, Poll}; use crate::service::HttpService; diff --git a/hyper/src/service/make.rs b/hyper/src/service/make.rs index cf542f1..f2941f5 100644 --- a/hyper/src/service/make.rs +++ b/hyper/src/service/make.rs @@ -8,8 +8,6 @@ pub(crate) trait MakeConnection: self::sealed::Sealed<(Target,)> { type Connection: AsyncRead + AsyncWrite; type Error; type Future: Future>; - fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll>; - fn make_connection(&mut self, target: Target) -> Self::Future; } impl self::sealed::Sealed<(Target,)> for S where S: Service {} impl MakeConnection for S @@ -20,12 +18,6 @@ where type Connection = S::Response; type Error = S::Error; type Future = S::Future; - fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll> { - loop {} - } - fn make_connection(&mut self, target: Target) -> Self::Future { - loop {} - } } pub trait MakeServiceRef { type ResBody;