Skip to content

Commit d2b0238

Browse files
committed
into_reader
1 parent 5d0c49b commit d2b0238

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/server.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ where
5353

5454
// If we have reference to the stream, unwrap it. Otherwise,
5555
// get the underlying stream from the request
56-
let to_decode = decoded.into_stream();
56+
let to_decode = decoded.into_reader();
5757

5858
// Copy the response into the writer
5959
io::copy(&mut res, &mut writer).await?;
@@ -264,10 +264,11 @@ impl DecodedRequest {
264264
}
265265
}
266266

267-
/// Consume self and get access to the underlying stream
267+
/// Consume self and get access to the underlying reader
268268
///
269-
/// If the request has a body, the underlying stream is t
270-
fn into_stream(self) -> Box<dyn BufRead + Unpin + Send + 'static> {
269+
/// When the request has a body, the underlying reader is the body.
270+
/// When it does not, the underlying body has been passed alongside the request.
271+
fn into_reader(self) -> Box<dyn BufRead + Unpin + Send + 'static> {
271272
match self {
272273
DecodedRequest::WithBody(r) => r.into_body_reader(),
273274
DecodedRequest::WithoutBody(_, s) => s,

0 commit comments

Comments
 (0)