Skip to content

Commit 7dc2cb3

Browse files
authored
conduit::RequestExt: Remove redundant accessor methods (#5834)
1 parent dcf622e commit 7dc2cb3

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

conduit/src/lib.rs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -28,60 +28,26 @@ pub fn box_error<E: Error + Send + 'static>(error: E) -> BoxError {
2828
}
2929

3030
pub trait RequestExt {
31-
/// The request method, such as GET, POST, PUT, DELETE or PATCH
32-
fn method(&self) -> &Method;
33-
34-
/// The request URI
35-
fn uri(&self) -> &Uri;
36-
3731
/// The byte-size of the body, if any
3832
fn content_length(&self) -> Option<u64>;
3933

40-
/// The request's headers, as conduit::Headers.
41-
fn headers(&self) -> &HeaderMap;
42-
4334
/// A Reader for the body of the request
4435
///
4536
/// # Blocking
4637
///
4738
/// The returned value implements the blocking `Read` API and should only
4839
/// be read from while in a blocking context.
4940
fn body(&mut self) -> &mut dyn Read;
50-
51-
/// A readable map of extensions
52-
fn extensions(&self) -> &Extensions;
53-
54-
/// A mutable map of extensions
55-
fn extensions_mut(&mut self) -> &mut Extensions;
5641
}
5742

5843
impl RequestExt for ConduitRequest {
59-
fn method(&self) -> &Method {
60-
self.method()
61-
}
62-
63-
fn uri(&self) -> &Uri {
64-
self.uri()
65-
}
66-
6744
fn content_length(&self) -> Option<u64> {
6845
Some(self.body().get_ref().len() as u64)
6946
}
7047

71-
fn headers(&self) -> &HeaderMap {
72-
self.headers()
73-
}
74-
7548
fn body(&mut self) -> &mut dyn Read {
7649
self.body_mut()
7750
}
78-
79-
fn extensions(&self) -> &Extensions {
80-
self.extensions()
81-
}
82-
fn extensions_mut(&mut self) -> &mut Extensions {
83-
self.extensions_mut()
84-
}
8551
}
8652

8753
/// A Handler takes a request and returns a response or an error.

0 commit comments

Comments
 (0)