From 079357a8c6dca469f6d84be5b6532fe2c5fba80a Mon Sep 17 00:00:00 2001 From: jkleint Date: Sat, 15 Nov 2014 17:01:48 -0500 Subject: [PATCH] Fix client example so it compiles `URL::parse()` needs an `unwrap()`, the `let res = ...` needs a semicolon, and I changed the example to set a real header. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2306e0dc..ca292135 100644 --- a/README.md +++ b/README.md @@ -46,17 +46,17 @@ Client: ```rust fn main() { // Creating an outgoing request. - let mut req = Request::get(Url::parse("http://www.gooogle.com/")).unwrap(); + let mut req = Request::get(Url::parse("http://www.gooogle.com/").unwrap()).unwrap(); // Setting a header. - req.headers_mut().set(Foo); + req.headers_mut().set(Connection(vec![Close])); // Start the Request, writing headers and starting streaming. let res = req.start().unwrap() // Send the Request. .send().unwrap() // Read the Response. - .read_to_string().unwrap() + .read_to_string().unwrap(); println!("Response: {}", res); }