make Client: Send + Sync, RequestBuilder: Send, Response: Send

This commit is contained in:
Sean McArthur
2016-12-02 15:36:33 -08:00
parent 552f4712cd
commit d18a53b3fc
3 changed files with 66 additions and 17 deletions

View File

@@ -21,7 +21,7 @@ impl Body {
///
/// A `Body` constructed from a set of bytes, like `String` or `Vec<u8>`,
/// are stored differently and can be reused.
pub fn new<R: Read + 'static>(reader: R) -> Body {
pub fn new<R: Read + Send + 'static>(reader: R) -> Body {
Body {
reader: Kind::Reader(Box::new(reader), None),
}
@@ -53,7 +53,7 @@ pub fn read_to_string(mut body: Body) -> ::std::io::Result<String> {
}
enum Kind {
Reader(Box<Read>, Option<u64>),
Reader(Box<Read + Send>, Option<u64>),
Bytes(Vec<u8>),
}