From 9e579472ca2dc0560d0fc5c81e8bc5a837b4a368 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Wed, 4 Jan 2023 21:19:06 +0100 Subject: [PATCH] conduit::RequestExt: Remove redundant accessor methods --- conduit/src/lib.rs | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/conduit/src/lib.rs b/conduit/src/lib.rs index a05e83d07c4..dc8bdf03142 100644 --- a/conduit/src/lib.rs +++ b/conduit/src/lib.rs @@ -28,18 +28,9 @@ pub fn box_error(error: E) -> BoxError { } pub trait RequestExt { - /// The request method, such as GET, POST, PUT, DELETE or PATCH - fn method(&self) -> &Method; - - /// The request URI - fn uri(&self) -> &Uri; - /// The byte-size of the body, if any fn content_length(&self) -> Option; - /// The request's headers, as conduit::Headers. - fn headers(&self) -> &HeaderMap; - /// A Reader for the body of the request /// /// # Blocking @@ -47,41 +38,16 @@ pub trait RequestExt { /// The returned value implements the blocking `Read` API and should only /// be read from while in a blocking context. fn body(&mut self) -> &mut dyn Read; - - /// A readable map of extensions - fn extensions(&self) -> &Extensions; - - /// A mutable map of extensions - fn extensions_mut(&mut self) -> &mut Extensions; } impl RequestExt for ConduitRequest { - fn method(&self) -> &Method { - self.method() - } - - fn uri(&self) -> &Uri { - self.uri() - } - fn content_length(&self) -> Option { Some(self.body().get_ref().len() as u64) } - fn headers(&self) -> &HeaderMap { - self.headers() - } - fn body(&mut self) -> &mut dyn Read { self.body_mut() } - - fn extensions(&self) -> &Extensions { - self.extensions() - } - fn extensions_mut(&mut self) -> &mut Extensions { - self.extensions_mut() - } } /// A Handler takes a request and returns a response or an error.