Make Request::send more general.

Removes `+ 'static` constraint from the `impl Read` parameter.
For this, lifetime parameters are added to `Payload` and `SizedReader`.
This commit is contained in:
Frank Steffahn
2020-10-25 21:51:04 +01:00
parent 22e3839340
commit c8cd130770
2 changed files with 13 additions and 13 deletions

View File

@@ -227,7 +227,7 @@ impl Request {
/// .set("Content-Type", "text/plain")
/// .send(read);
/// ```
pub fn send(&mut self, reader: impl Read + 'static) -> Response {
pub fn send(&mut self, reader: impl Read) -> Response {
self.do_call(Payload::Reader(Box::new(reader)))
}