1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-20 04:35:38 +02:00

Use non-consuming builder pattern for ClientRequest

This commit is contained in:
Nikolay Kim
2019-04-01 15:19:34 -07:00
parent 5c4e4edda4
commit 38afc93304
3 changed files with 161 additions and 126 deletions

View File

@@ -105,7 +105,7 @@ impl Client {
let mut req = ClientRequest::new(method, url, self.0.clone());
for (key, value) in &self.0.headers {
req.head.headers.insert(key.clone(), value.clone());
req.set_header_if_none(key.clone(), value.clone());
}
req
}
@@ -120,7 +120,7 @@ impl Client {
{
let mut req = self.request(head.method.clone(), url);
for (key, value) in &head.headers {
req.head.headers.insert(key.clone(), value.clone());
req.set_header_if_none(key.clone(), value.clone());
}
req
}