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:
@@ -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)))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user