diff --git a/src/hyper014.rs b/src/hyper014.rs index 0a8e542..56e9b6b 100644 --- a/src/hyper014.rs +++ b/src/hyper014.rs @@ -6,7 +6,6 @@ use crate::request::LambdaHttpEvent; use core::convert::TryFrom; use core::future::Future; use lambda_runtime::{Error as LambdaError, LambdaEvent, Service as LambdaService}; -use std::convert::Infallible; use std::pin::Pin; type HyperRequest = hyper::Request; @@ -69,7 +68,7 @@ type HyperResponse = hyper::Response; /// ``` pub async fn run_hyper_on_lambda(svc: S) -> Result<(), LambdaError> where - S: hyper::service::Service, Error = Infallible> + S: hyper::service::Service, Error = LambdaError> + 'static, B: hyper::body::HttpBody, ::Error: std::error::Error + Send + Sync + 'static, @@ -81,20 +80,19 @@ where /// Lambda_runtime handler for hyper struct HyperHandler(S) where - S: hyper::service::Service, Error = Infallible> - + 'static, + S: hyper::service::Service> + 'static, B: hyper::body::HttpBody, ::Error: std::error::Error + Send + Sync + 'static; impl LambdaService>> for HyperHandler where - S: hyper::service::Service, Error = Infallible> + S: hyper::service::Service, Error = LambdaError> + 'static, B: hyper::body::HttpBody, ::Error: std::error::Error + Send + Sync + 'static, { type Response = serde_json::Value; - type Error = Infallible; + type Error = LambdaError; type Future = Pin>>>; /// Returns Poll::Ready when servie can process more requrests.