From 90f27837b3571a19e3e7d00dd467f9b197a335c8 Mon Sep 17 00:00:00 2001 From: Glenn Griffin Date: Tue, 10 Dec 2019 13:50:46 -0800 Subject: [PATCH] fix type composoble -> composable --- src/lib.rs | 4 ++-- src/responders.rs | 1 - src/server.rs | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index bdd3282..5b05881 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -75,7 +75,7 @@ //! //! ## Request Matchers //! -//! Defining which request an expecation matches is done in a composoble manner +//! Defining which request an expecation matches is done in a composable manner //! using a series of traits. The core of which is //! [Mapper](mappers/trait.Mapper.html). The `Mapper` trait is generic //! over an input type, has an associated `Out` type, and defines a single method @@ -88,7 +88,7 @@ //! Matcher trait simply provides a `matches` method. //! //! A request matcher is any `Matcher` that takes accepts a -//! `hyper::Request>` as input. +//! `hyper::Request` as input. //! //! With that understanding we can discuss how to easily define a request //! matcher. There are a variety of pre-defined mappers within the `mappers` diff --git a/src/responders.rs b/src/responders.rs index e0d4f37..4cf60ae 100644 --- a/src/responders.rs +++ b/src/responders.rs @@ -95,7 +95,6 @@ where async fn _respond(resp: hyper::Response) -> hyper::Response { resp } - // Turn &hyper::Response> into a hyper::Response let mut builder = hyper::Response::builder(); builder = builder .status(self.status().clone()) diff --git a/src/server.rs b/src/server.rs index 41c2f2b..f0448fd 100644 --- a/src/server.rs +++ b/src/server.rs @@ -6,7 +6,7 @@ use std::pin::Pin; use std::sync::{Arc, Mutex}; // type alias for a request that has read a complete body into memory. -type FullRequest = hyper::Request>; +type FullRequest = hyper::Request; /// The Server pub struct Server { @@ -44,7 +44,7 @@ impl Server { // read the full body into memory prior to handing it to mappers. let (head, body) = req.into_parts(); let full_body = hyper::body::to_bytes(body).await?; - let req = hyper::Request::from_parts(head, full_body.to_vec()); + let req = hyper::Request::from_parts(head, full_body); log::debug!("Received Request: {:?}", req); let resp = on_req(state, req).await; log::debug!("Sending Response: {:?}", resp);